Visitnorway Import API

Overview 

This API is created for destinations and partners to send their account, listing and event data to Norway CRM so it will be visible on Visit Norway's websites. This document will try to guide developers on how they can implement it. 

 

How to create the best listings

See our https://visitnorway.atlassian.net/wiki/spaces/VNPUB/pages/1529085957 article for good tips and tricks.

Note: This article is based on Tellus, but we supports all these fields.

 

Access or questions

To get access to the API you need to request access by email.  

Contact Jørgen Flo, jorgen.flo@innovasjonnorge.no  

 

Environments 

New development URL (Updated May 10th 2023)

When developing and testing always use the development environment.

 

Structure

Before starting to use the API you should know how the structure is built. All API users are connected to a destination/partner and have only access to data for that owner. The owner of a listing is always visible on a listing/event page showed as the source.

 

 

Example

Here you can see an example on how a listing should be created for a company. The company named Norway Hikes and Accommodation want to be visible. They have a hiking tour and 1 hotel. The hotel also have a restaurant.

 

First we need to create an account

{ "username":"*USERNAME*", "password": "*PASSWORD*", "action": "addAccount", "data" : { "Company": "Norway Hikes and Accommodation", // Required "SortCompany":"Norway Hikes and Accommodation", "ExternalAcctID" : "1237", // If you have this in another system, select that ID here. If this ID already exists you will get an error "Email" : "hello@nhaa.no", "WebURL" : "www.norway-hikes-accommodation.no", "Phone" : "123 45 678", "Addresses" : [{ "AddressTypeID" : 1, "Addr1" : "Østsidevegen 11", "City" : "Hurdal", "State" : "Viken", "Zip" : "2090", "Country" : "Norge" }] } }

 

You can get all arguments with this this call

{ "username":"*USERNAME*", "password": "*PASSWORD*", "action": "getArguments", "data" : { "Action": "addAccount" // Select action here } }

 

After this call you will get a response with the newly created account ID

{"Success":1,"Data":{"AcctID":12345}}

 

Now that the account is created we can start adding their listings. Each tour should be its own listing.

Remember to add ExternalListingID so translated versions gets connected

 

When you have created the listing you will get the response with the listing ID.

 


Let’s create the hotel listing with the API call


After this call we get the listing ID but this listing seems a bit empty. There is more fields we can add to this hotel.

First lets see what amenities we can add

 

 

Lets add some amenities

 

 

 

Use action "getListingSubCats”

Use “getArguments”

 

 

API Overview

 

 

General

 

getArguments

GetArguments returns a structure consisting of argument names, data types, if the argument is required, and a quick synopsis of each field for any given function. GetArguments accepts one argument, Action, which is the name of the function in question. This should be updated and maintained by a developer whenever changes are made to the import API, and heavily utilized by the user when importing data.

 

 

getLocales

GetLocales returns a structure of available locales within the CRM. Locales are the language code which the account will be associated with. GetLocales doesn't require any data.

Example

 

getAmenities

Returns a structure containing all amenities, the tab name, group name, field id and data type. GetAmenities doesn't require any data.

 

 

Green Travel

 

Eco-certification is set on the listing level and should be connected to an expiration date. If no expiration date is included a default expiration date will be set.

Eco certifications can be set when adding new listing or updating a existing one.

 

Example of updating a listing with expiration date to the differerent certificates:

 

 

Accounts

Accounts stores the core company info for the listings and events.

 

 

getAccount

Used for informational purposes. GetAccount returns a structure containing information about an account including the Account ID, the Company name, the email address associated with the account as well as the ExternalAcctID. Users cannot access any accounts that they did not add themselves. This function requires the AcctID when called.

 

 


getAccounts

Used for informational purposes. GetAccounts returns a structure containing all accounts added by the requesting user. Information for each account includes Account ID, Company Name, the email address associated with the account as well as the ExternalAcctID. Users do not have to provide any data to call this function.

 

 

addAccount

addAccount allows users to add an account to the CRM.

 

 

updateAccount

Users may update any accounts previously imported. They update the account by using the AcctID, if they do not know the AcctID, they should call the getAccounts function which returns all accounts previously added by them.

 

 

deleteAccount

By providing an AcctID, users may delete an account they have previously added.

 

getAccountAmenities

Used for informational purposes. Returns a structure containing all amenity information for a specific account. Data returned includes amenity field ID, Label, and Value.

 

 

updateAccountAmenities

Calling this function allows users to add amenities as well as update existing amenity data. It's critical that users call the getAmenities function prior to updating amenity information, as the fieldID used for this function is not the amenity fieldID we see in the CRM.

 

 

deleteAccountAmenities

By providing the AcctID and a list of FieldIDs users may delete the specific amenity information associated with that account. It's critical that users call the getAmenities function prior to updating amenity information, as the fieldID used in this function is not the amenity fieldID we see in the CRM.

 

 

Listings

Remember to read through https://visitnorway.atlassian.net/wiki/spaces/VNPUB/pages/1529085957 to get more knowledge on how to create a better performing listing

 

getListingSubCats

Used for informational purposes. Returns a structure of listing SubCat ID's and their Name. This function doesn't require any data.

 

 

getListings

Used for informational purposes. Returns all listings associated with an account. The data returns includes the AcctID, Account Name, ListingID, Listing, locale and external listing ID.

 

 

getListing

Used for informational purposes. Returns a structure containing all information associated with an existing listing. Data returned includes Listing ID, local, Account ID, Listing, TAID, Account Name, Address, Email, WebURL, Phone, Longitude, Latitude, External Listing ID, Sub Categories, any UDF data, images, and social media information.

 

 

addListing

AddListing allows users to add a listing to the CRM. An account must first be created in order to add a listing, as all listings require an associated account.

 

 

updateListing

By providing a listingID users can update an existing listing.

 

 

deleteListing

By providing a listing ID users are able to delete a listing they have previously created.

 

 

getListingImages

Returns a structure containing all image data associated with a particular listing, including the MediaID, TypeID, Caption, MediaName, MediaFile, SortOrder, and ExternalMediaID.

 

 

 

addListingImage

This function adds images to listings one at a time.

 

 

updateListingImage

Edits may be made to a listing image by using the mediaID. To get the mediaID call the getListingImages function.

 

 

deleteListingImage

Users may delete a particular image by providing the media ID. To get the mediaID call the getListingImages function.

 

 

 

Events

 

getEventCats

Used for informational purposes. Returns a structure containing all event categories and their associated names.

 

getEvents

Used for informational purposes. Returns all events associated with a particular Account. Data returned includes AcctID, EventID, Title, Description, StartDate, Event Type, and External Event ID.

 

 

 

getEvent

Used for information purposes. Returns event data associated with a particular event ID. Data returned includes AcctID, AccountName, EventID, Title, Description, Start Date, Event Type, External Event ID, Latitude, Longitude, Event Dates, Event Media, and Event Categories.

 

 

addEvent

Allows users to add an event to the CRM. All events added via the Import API tool must be associated with an existing account.

 

 

updateEvent

By providing an Event ID users may update an event they previously created.

 

 

deleteEvent

By providing an event ID users may delete an event they've previously added to the CRM.

 

 

getEventImages

Used for informational purposes. This function returns a structure containing information on all media associated with an event. Data returned includes MediaID, Media File, Sort Order and External Media ID.

 

 

addEventImage

Allows users to add an image to an event.

 

 

 

updateEventImage

Users may update existing images associated with an event. This function requires a mediaID, if the user does not know the MediaID, they should call the getEventImages function.

 

 

 

deleteEventImage

By providing a media ID users are able to delete a particular image associated with an event. If the user does not know the media Id, they should call the getEventImages function.