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 need | Already on tour? | How to retrieve |
|---|---|---|
| Title | Yes (tour.title) | No need to call — tour.getTitle() if you want the method form |
| Description | Yes (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 images | No | tour.getImages() (only if tour.imageCount > 1) |
| Audios | No | tour.getAudios() — only if tour.hasAudios is true |
| Location | Yes (tour.location) | No need to call — use tour.location directly (tour.getLocation() if you want the method form) |
| Attractions | No | tour.getAttractions() — only if tour.attractionsCount > 0 |
| Collections | No | tour.getCollections() — only if tour.collectionsCount > 0 |
| Full details | No | tour.getDetails() |
Methods
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
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
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.
| Method | What it returns | When to call |
|---|---|---|
getTitle() | Title | Tour already exposes title directly — rarely needed |
getDescription() | Description | Tour already exposes description directly — rarely needed |
getImages() | All images | Tour exposes the first image via tour.image; call to get all images |
getAudios() | All audios | Only if tour.hasAudios is true |
getLocation() | Location | Tour already exposes location directly — rarely needed |
getAttractions() | Attractions | Only if tour.attractionsCount > 0 |
getCollections() | Collections | Only if tour.collectionsCount > 0 |
getDetails() | Full details | Use 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
| Status | Message | Cause |
|---|---|---|
401 | X-IZI-Partner-Key header is required | Missing partner key |
401 | Invalid partner key | Partner key is not correct |
403 | Partner is inactive | The partner account has been disabled |
429 | PARTNER CREDIT LIMIT | Partner has run out of credits |
500 | PARTNER USER CHARGING FAILED | Charging service error |
500 | Content not found. | The requested content could not be retrieved |
403 | Unknown domain | Requests from domains that are not registered for the specified partner do not receive access. |