Overview

This documentation covers the IZI Web SDK, which provides partners with access to curated tours and museum content. The SDK can be embedded in web applications via the JavaScript bundle.

Web SDK Script

Include the partner SDK script on your web page. Choose either the JavaScript or TypeScript bundle:

<script src="https://sdk.izi.travel/partner_izi_access.min.js"></script>

or

<script src="https://sdk.izi.travel/partner_izi_access_ts.min.js"></script>

Initialization

Initialize the SDK with your partner key before calling any methods:

IziAccess.init({
  partnerKey: "#{yourPartnerKey}"
});

SDK Usage

The SDK returns rich tour objects that expose both direct properties and asynchronous methods. Some data is available on the tour object directly (like tour.title, tour.description, tour.image, tour.location), while other data only exists after you call a method. Use the counts and has... flags to decide whether a method call is needed.

Get Partner Tours

The basic call returns a list of tours associated partner key:

const tours = await IziAccess.partnerTours();

These following options can be added as well like this:

const tours = await IziAccess.partnerTours({
  languages: ["en"],
  page: 1,
  per_page: 10
});

Response

Each element of the returned array is a tour object that exposes summary data directly plus availability flags and counts:

[{
  title: "Burj Khalifa",
  description: "this is dubai tour",
  image: {
    url: "https://example.com",
    position: 0
  },
  location: "57.6257453484716,39.8351888034338",

  hasTitle: true,
  hasDescription: true,
  hasImage: true,
  hasLocation: true,
  hasAttractions: true,
  hasAudios: false,

  attractionsCount: 26,
  audioCount: 0,
  collectionsCount: 0,
  imageCount: 2
}]

When to call which method

Some data is already available as a direct property on the tour, while other data only exists after you call a method. Use the counts and has... flags to decide whether to call:

What you needAlready on tour?How to retrieve
TitleYes (tour.title)No need to call — tour.getTitle() if you want the method form
DescriptionYes (tour.description)No need to call — tour.getDescription() if you want the method form
First image (preview)Yes (tour.image)No need to call — use tour.image directly
All imagesNotour.getImages() (only if tour.imageCount > 1)
AudiosNotour.getAudios() — only if tour.hasAudios is true
LocationYes (tour.location)No need to call — use tour.location directly (tour.getLocation() if you want the method form)
AttractionsNotour.getAttractions() — only if tour.attractionsCount > 0
CollectionsNotour.getCollections() — only if tour.collectionsCount > 0
Full detailsNotour.getDetails()

Methods

Tip: title, description, and location are already available as direct properties on the parent tour, so you can read them without calling any method. The method form (getTitle(), getDescription(), getLocation()) is provided for cases where you prefer it.

1. getTitle()

Gets the tour title.

const title = await tour.getTitle();
console.log(title);
// "Paris Walking Tour"

2. getDescription()

Gets the complete description.

const description = await tour.getDescription();
console.log(description);
// "Explore the most famous landmarks of Paris."

3. getImages()

Gets all images. Note that the direct tour.image property only gives the first image. Each image object carries its url and a position.

const images = await tour.getImages();
console.log(images);

// [
//   {
//     url: "https://media.izi.travel/ee00832f-3e42-4495-905e-c.../6c7f5e9b-0c85-4818-8c7f-5f7f27c138d7_800x600.jpg",
//     position: 0
//   }
// ]

4. getAudios()

Gets all audios. Each entry is the audio URL string.

const audios = await tour.getAudios();
console.log(audios);

// [
//   "https://media.izi.travel/cc95b2a6-7704-40e9-842d-d...090708de/ee84896e-1e98-4a81-80d1-f8bd4d2a21bb.m4a"
// ]

5. getLocation()

Gets the location. Returns null if there is no location. You can check first with tour.hasLocation:

if (tour.hasLocation) {
  const location = await tour.getLocation();
  console.log(location);
  // "48.856613,2.352222"
}

Attractions

Note: unlike the parent tour, a nested attraction does not expose title, description, image, audios, or location as direct properties. You must call the corresponding method (getTitle(), getDescription(), getImages(), getAudios(), getLocation()) to retrieve any of these.

6. getAttractions()

Gets the attractions of the tour. Only call this if tour.attractionsCount > 0.

if (tour.attractionsCount > 0) {
  const attractions = await tour.getAttractions();

  for (const attraction of attractions) {
    // An attraction only exposes has... flags
    console.log(attraction.hasTitle);
    console.log(attraction.hasDescription);
    console.log(attraction.hasImage);
    console.log(attraction.hasAudios);
    console.log(attraction.hasLocation);

    // Retrieve actual data via methods
    const title       = await attraction.getTitle();
    const description = await attraction.getDescription();
    const images      = await attraction.getImages();
    const audios      = await attraction.getAudios();
    const location    = await attraction.getLocation();
  }
}

Collections

Note: like attractions, a collection does not expose title, description, image, audios, or location directly. You must call the corresponding method to retrieve them.

7. getCollections()

Gets collections belonging to the tour or object. Only call this if tour.collectionsCount > 0.

if (tour.collectionsCount > 0) {
  const collections = await tour.getCollections();

  for (const collection of collections) {
    // Retrieve actual data via methods
    const title       = await collection.getTitle();
    const description = await collection.getDescription();
    const images      = await collection.getImages();
    const audios      = await collection.getAudios();
    const location    = await collection.getLocation();

    // Collections can also nest collections
    const subCollections = await collection.getCollections();
  }
}

Method Summary

The parent tour already exposes title, description, the first image, and location as direct properties, so those do not require a method call. The methods below are for retrieving additional content — full image lists, audios, nested attractions, collections, or the complete object details.

MethodWhat it returnsWhen to call
getTitle()TitleTour already exposes title directly — rarely needed
getDescription()DescriptionTour already exposes description directly — rarely needed
getImages()All imagesTour exposes the first image via tour.image; call to get all images
getAudios()All audiosOnly if tour.hasAudios is true
getLocation()LocationTour already exposes location directly — rarely needed
getAttractions()AttractionsOnly if tour.attractionsCount > 0
getCollections()CollectionsOnly if tour.collectionsCount > 0
getDetails()Full detailsUse to retrieve the complete object payload

Domain Restriction

Only domains registered for your partner account are accepted. Any request originating from a domain that has not been registered will be rejected and no tours will be returned.

Errors

StatusMessageCause
401X-IZI-Partner-Key header is requiredMissing partner key
401Invalid partner keyPartner key is not correct
403Partner is inactiveThe partner account has been disabled
429PARTNER CREDIT LIMITPartner has run out of credits
500PARTNER USER CHARGING FAILEDCharging service error
500Content not found.The requested content could not be retrieved
403Unknown domainRequests from domains that are not registered for the specified partner do not receive access.