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 destinationsaccept 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
NOboolean

true or false (true when the View is presented with price closed, false when the View is presented with price dynamic)

price
NOfloat

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 
integerThematic 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)

zoneNO

Cruise Zone Code (see "cruise zone parameters list") 
type_view
YESstring
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)

shipsNOstring

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 Viewboolean
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


    {
    1.     type_view"Destination",
      1.   arrival_date"30/03/2020",
      2.   view_https"https://tests.view-travel.com/destination/lima-bogota-mexico-madrid-barcelona/7ZAFk5Dt",
      3.   view_url"http://tests.view-travel.com/destination/lima-bogota-mexico-madrid-barcelona/7ZAFk5Dt",
      4.   title"Lima - Bogota - Mexico - Madrid - Barcelona",
      5.   text"",
      6.   price2000,
      7.   is_activetrue,
      8.   departure"LIM",
      9.   price_fromtrue,
      10.   background_videotrue,
      11.   background_photo: false,
      12.   departure_date"21/03/2020",
      13.   automatictrue,
      14.   is_closedtrue,
      15.   destinations"BOG,MEX,MAD,BCN",
    }

    See Example Request JSBin

    Edit View

    https://view-travel.com/v1/api/view/<code>    /* Production environment */
    https://tests.view-travel.com/v1/api/view/<code>  /* Test environment */

    See Example Request Edit-view JSBin

    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_destinationsOnly when you want to search the destinations
    booleanValues (true or false)
    departure_date
    NO
    string
    dd/MM/yyyy
    arrival_date
    NO
    string
    dd/MM/yyyy
    price
    NOfloat

    tags
    Only when you need search Views by Tags
    string

    Tag separated by vertical bar (|)

    Ex: "TagNameOne|TagName2|TagName"

    language_codeYESstringLangauge code (es, en, pt)
    pageOnly when you need to return more than 10 resultsinteger
    • 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

    {
      1.    total_views: 120,

      2. back_page_number: null,

      3. exist: true,
      4.      code"OjUbQC1R",
      5.      title"AUSTRALIA ESPECTACULAR",
      6. sub_title: "",

      7. view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",
      8. view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
      9.     image: "https://d2kbgkijzot24d.cloudfront.net/destinos/inspiravia/photos/lima_peruthe_plaza_de_armas_de_lima_by_day_8444360764-s.jpg",
      10.       tags: [],
      11. price: 2000,
      12. .
    1.        .
    2.        .






    }

    Advance example Search Views

    See Example Request JSBin


    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_startNOstringdd/MM/yyyy
    date_end
    NO
    string
    dd/MM/yyyy
    language_codeYESstringLangauge code (es, en, pt)
    pageOnly when you need to return more than 10 resultsinteger1,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

    {
      1.    total_views: 120,

      2. back_page_number: null,

      3. exist: true,
      4.      code"OjUbQC1R",
      5.      title"AUSTRALIA ESPECTACULAR",

      6. view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",
      7. view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
      8.    
      9. .
    1.        .
    2.        .






    }

    Advance example Search Views Sent

    See Example Request JSBin


    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

    {
      1.      code"OjUbQC1R",
      2.      title"AUSTRALIA ESPECTACULAR",

      3. view_url: "http://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R",
      4. view_url_s: "https://tests.view-travel.com/destino/australia-espectacular/OjUbQC1R,
      5.    
      6. .
    1.        .
    2.        .






    }

    Advance example Detail view by code