Create View
- Request urls API
https://view-travel.com/v1/api/view/ /* Production environment */
https://tests.view-travel.com/v1/api/view/ /* Test environment */
List of parameters to create the view
PARAMETERS | MANDATORY | TYPE | VALUES THAT CAN BE TAKEN |
title | YES | string | Title with which you want to present the view |
subtitle | NO | string | Subtitle with which you want to present the view |
text | NO | string | Text with which you want to present the view |
departure | YES | string | Departure city code (see List of destinations) accept IATA Code |
destinations | YES | string | The codes of the cities separated by comma (see List of destinations) accept IATA codes |
departure_date | NO | string | dd/MM/yyyy |
arrival_date | NO | string | dd/MM/yyyy |
is_closed | NO | boolean | true or false (true when the View is presented with price closed, false when the View is presented with price dynamic) |
price | NO | float | |
price_from | NO | boolean | true or false |
background_video | Only when a view with background videos is generated | boolean | true or false |
background_photo | Only when a view with background photos is generated | boolean | true or false |
thematic | Only when a view with background theme is generated | integer | Thematic id (see "List of thematic ids" ) |
hotels | NO | string | The codes of the hotels separated by comma (see Hotel code list) e.g.(pBJ6PGi7TeLz,hyxCjsrUrXSp,2gPn3qU0dTQE) |
zone | NO | Cruise Zone Code (see "cruise zone parameters list") | |
type_view | YES | string | Destination, Cruise, Cruise+stay |
currency | Only when you have entered the price parameter | integer | ids currency |
shipping_company | NO | integer | Shipping companies IDS (see "list of shipping parameters" in help manuals) |
ships | NO | string | The codes of the boats separated by comma (see Boats code list) e.g.(MNZcBjmN16WP,wU4JCMaDZSDL,MNZcBjmN17tQ) |
is_active | NO | boolean | true or false |
repeat | Only when you want to create a View with the existing content | boolean | true or false Pass true when you want to create a videoview with the content of an existing one. |
hide | Only when you need to hide the menu, text and social media icons en the View | boolean | true or false |
automatic | Only when you want to create reservations (bookings) of flights, hotels, cruises automatically | boolean | true or false (default value is false) |
repeat_title | Only when you want to create Views with the some | boolean | true or false |
presentation | Only for viewmice | integer | ids (2, 3, 5) 2: Presentation A 3: Presentation B 5: Presentation C |
- This is an example request using javascript fetch
let
params = { 'title': 'Lima - Bogota - Mexico - Madrid - Barcelona', 'text': '', 'departure': 'LIM', 'destinations': 'BOG,MEX,MAD,BCN', 'price': 2000, 'departure_date': '21/03/2020', 'arrival_date': '30/03/2020', 'background_video': true, 'background_photo': false, 'type_view': 'Destination', 'is_closed': true, 'hotels': 'pBJ6PGi7TeLz,hyxCjsrUrXSp,2gPn3qU0dTQE', 'automatic': true,
'is_active': true,
'price_from': true, }
const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
fetch('https://tests.view-travel.com/v1/api/view/', { method: 'post', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', 'Authorization': token, }, body: JSON.stringify(params) }) . then(res => res.json()) .catch(error => console.error('Error:', error)) .then(response => console.log('Success:', response));
- This is a successful response
{
- type_view: "Destination",
- arrival_date: "30/03/2020",
- view_https: "https://tests.view-travel.com/destination/lima-bogota-mexico-madrid-barcelona/7ZAFk5Dt",
- view_url: "http://tests.view-travel.com/destination/lima-bogota-mexico-madrid-barcelona/7ZAFk5Dt",
- bookings: [{…}, {…}, {…}, {…}, {…}],
- title: "Lima - Bogota - Mexico - Madrid - Barcelona",
- text: "",
- price: 2000,
- is_active: true,
- departure: "LIM",
- price_from: true,
- background_video: true,
- background_photo: false,
- departure_date: "21/03/2020",
- hotels: [],
- automatic: true,
- is_closed: true,
- destinations: "BOG,MEX,MAD,BCN",
}
Edit View
https://view-travel.com/v1/api/view/<code> /* Production environment */
https://tests.view-travel.com/v1/api/view/<code> /* Test environment */
Duplicate View
https://view-travel.com/v1/api/duplicate-view/ /* Production environment */
https://tests.view-travel.com/v1/api/duplicate-view/ /* Test environment */
Search View
- Request urls API
https://view-travel.com/v1/api/view-search/ /* Production environment */
https://tests.view-travel.com/v1/api/view-search/ /* Test environment */
List of parameters to search views
PARAMETERS | MANDATORY | TYPE | VALUES THAT CAN BE TAKEN |
query | NO | string | Find by title, subtitle, departure, destination, country, username |
only_destinations | Only when you want to search the destinations | boolean | Values (true or false) |
departure_date | NO | string | dd/MM/yyyy |
arrival_date | NO | string | dd/MM/yyyy |
price | NO | float | |
tags | Only when you need search Views by Tags | string | Tag separated by vertical bar (|) Ex: "TagNameOne|TagName2|TagName" |
language_code | YES | string | Langauge code (es, en, pt) |
page | Only when you need to return more than 10 results | integer |
- This is an example request using javascript fetch
const token = 'Token INSERT_YOUR_TOKEN';
let queryString = `query=Lima&tags="LimaTag|MexicoTag"&language_code=es`;
let url = `http://tests.view-travel.com/v1/api/view-search/?${queryString}`;
fetch(url, {
method: 'get',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
},
})
.then(res => res.json())
.catch(error => console.error('Error:', error))
.then(response => console.log('Success:', response));
- This is a successful response
{
}
- total_views: 120,
back_page_number: null,
exist: true,- views[ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…} ]
- code: "OjUbQC1R",
- title: "AUSTRALIA ESPECTACULAR",
- sub_title: "",
view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",- view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
- image: "https://d2kbgkijzot24d.cloudfront.net/destinos/inspiravia/photos/lima_peruthe_plaza_de_armas_de_lima_by_day_8444360764-s.jpg",
- tags: [],
- price: 2000,
- .
- .
- .
Views Sent
- Request urls API
https://view-travel.com/v1/api/views-sent/ /* Production environment */
https://tests.view-travel.com/v1/api/views-sent/ /* Test environment */
List of parameters to search views sent
PARAMETERS | MANDATORY | TYPE | VALUES THAT CAN BE TAKEN |
query | NO | string | Find by title, subtitle, departure, destination, country, username |
date_start | NO | string | dd/MM/yyyy |
date_end | NO | string | dd/MM/yyyy |
language_code | YES | string | Langauge code (es, en, pt) |
page | Only when you need to return more than 10 results | integer | 1,2 ... etc. |
- This is an example request using javascript fetch
const token = 'Token INSERT_YOUR_TOKEN';
let queryString = `query=Lima&language_code=es`;
let url = `http://tests.view-travel.com/v1/api/views-sent/?${queryString}`;
fetch(url, {
method: 'get',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
},
})
.then(res => res.json())
.catch(error => console.error('Error:', error))
.then(response => console.log('Success:', response));
- This is a successful response
{
}
- total_views: 120,
back_page_number: null,
exist: true,- views[ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…} ]
- code: "OjUbQC1R",
- title: "AUSTRALIA ESPECTACULAR",
view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",- view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
- .
- .
- .
Advance example Search Views Sent
Detail View
- Request urls API
https://view-travel.com/v1/api/detail-view-by-code/ /* Production environment */
https://tests.view-travel.com/v1/api/detail-view-by-code/ /* Test environment */
List of parameters
PARAMETERS | MANDATORY | TYPE | VALUES THAT CAN BE TAKEN |
code | YES | string | view code |
- This is an example request using javascript fetch
const token = 'Token INSERT_YOUR_TOKEN';
let queryString = `code=CODEVIEW`;
let url = `http://tests.view-travel.com/v1/api/detail-view-by-code/?${queryString}`;
fetch(url, {
method: 'get',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': token,
},
})
.then(res => res.json())
.catch(error => console.error('Error:', error))
.then(response => console.log('Success:', response));
- This is a successful response
{
}
- code: "OjUbQC1R",
- title: "AUSTRALIA ESPECTACULAR",
view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",- view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
- .
- .
- .
Advance example Detail view by code