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 exist point parameters" in help manuals) accept IATA Code

destinations

YES

string

The codes of the cities separated by comma (see "list of destinations parameters" in help manuals) 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 parameters" in help manauals) 
hotels
NO
string
hotels IDS 
zoneNO

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

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': '12306,8251,23601',
      '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/    /* Production environment */
    https://tests.view-travel.com/v1/api/view/  /* Test environment */

    See Example Request Edit-view JSBin

    Duplicate View

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