Create Viewcontent

https://view-travel.com/v1/api/viewcontent/      /* Production environment */
https://tests.view-travel.com/v1/api/viewcontent/    /* Test environment */
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

language_code
YES
string
Values (es,en,pt)

title

NO

string

Title with which you want to present the view

destinations

YES

string

City codes separated by commas (see List of destinations)

hotels

NO

string

Hotels IDS separated by commas as example. (‘1,2,3,4’) (see “list of hotels videoviews parameters” in help manuals)

boats

NO

string

Boats IDS separated by commas as example (‘1,2,3,4’) (see “list of boats parameters” in help manuals)

shipping_company

NO

integer

Shipping companies IDS (see "list of shipping parameters" in help manuals)

repeat

Only when you want to create a

VideoView with the existing content

boolean

true or false



Pass true when you want to create a videoview with the content of an existing one.



    

  • This is an example request using Javascript fetch 

let params = {
      'title': 'Lima - Barcelona - modify',
	  'destinations': 'MEX,MAD,BCN',
	  'hotels': 'awDI9BhnqEwt,JZmGml6pAuep,oFrULd7uA59d',
'boats': '120,121,122', 'shipping_company': 40 } const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
fetch('https://tests.view-travel.com/v1/api/viewcontent/', { 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));        

  • Response success
{
      'code': 'q13pQY7EPEufEwJC',
'hotels': '12306,8251,23601',  'boats': '120,121,122', 'shipping_company': 40,
'code': 'q13pQY7EPEufEwJC',        'title': 'Lima - Barcelona',
'destinations': 'MEX,MAD,BCN', 'videoview':'https://tests.view-travel.com/watch?code=q13pQY7EPEufEwJC' }

https://codepen.io/lenines/pen/xxGxxge?editors=0012


Edit Viewcontent


https://viewcontent.view-travel.com/v1/api/viewcontent/      /* Production environment */
https://tests.view-travel.com/v1/api/viewcontent/     /* Test environment */             
  • This is an example request using javascript fetch
let params = {
      'title': 'Lima - Barcelona - modify',
	  'destinations': 'MEX,MAD,BCN',
	  'hotels': 'awDI9BhnqEwt,JZmGml6pAuep,oFrULd7uA59d',
	  'boats': '120,121,122',
	  'shipping_company': 40
 }
 
const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
fetch('https://tests.view-travel.com/api/videoview/', { 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));        
  • Response success
{
        'code': 'q13pQY7EPEufEwJC',
'results': {        'hotels': 'awDI9BhnqEwt,JZmGml6pAuep,oFrULd7uA59d',
       'boats': '120,121,122',     'shipping_company': 40,
    'code': 'q13pQY7EPEufEwJC',             'title': 'Lima - Barcelona - modify',
    'destinations': 'MEX,MAD,BCN',   }, 'videoview_url':'https://tests.view-travel.com/watch?code=q13pQY7EPEufEwJC' }

https://codepen.io/lenines/pen/qBdBbqa


Countries

https://content.view-travel.com/v1/api/countries/      /* Production environment */
https://tests.view-travel.com/v1/api/countries/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

query

NO

string

Find by country name

page

Only when you need to return more than 25 results

integer


  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let query = '',
    page = 1;
let params = new URLSearchParams(`query=${query}`);
			
if (page != '') {
    params.set('page', page);
}
			
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/countries/?${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) => { render_destinations(response) });
  • Response success
{
    count: 1,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/countries/?query=&page=1';
        previous: null,
   },      
    countries: [
        {
           code: 'AL',
	  name: 'Albania',
        },
        {
          code: 'DE',
	  name: 'Alemania',
      },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/LYZMEpw

Country Information

https://content.view-travel.com/v1/api/country/      /* Production environment */
https://tests.view-travel.com/v1/api/country/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by country code

language_code

YES

string

Values (es,en,pt)

type_infoYES
string

Values (basic, currency, communications, safety, transportation, others, all)        

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let code = 'PE',
    language_code = 'es',
    type_info = 'basic';
let params = new URLSearchParams(`code=${code}`);
			
if (language_code != '') {
    params.set('language_code', language_code);
}
if (type_info != '') {
    params.set('type_info', type_info);
}		
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/country/?${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) => { });
  • Response success

https://codepen.io/lenines/full/OJXrqqy

Destinations

https://content.view-travel.com/v1/api/destinations/      /* Production environment */
https://tests.view-travel.com/v1/api/destinations/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

query

YES

string

Find destination name or country name

language_codeYES
string
Language code (es,en,pt)

page

Only when you need to return more than 25 results

integer


exact
NO
boolean
true or false
  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let params = new URLSearchParams(`query=${query}`);
			
if (language_code != '') {
	params.set('language_code', language_code);
}
			
if (query != '') {
    params.set('query', query);
}

if (page != '') {
	params.set('page', page);
}

params.set('order_by', order_by);
			
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/destinations/?${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) => { render_destinations(response) });
  • Response success
{
    count: 1,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/destinations/?page=2&language_code=es&order_by=name';
        previous: null,
   },      
    destinations: [
        {
           code: 'AAH',
	  name: 'Aachen'
	  country:{
	      code: 'DE',
                 name: 'Alemania',
            }    
        },
        {
          code: 'AAL',
	  name: 'Aalborg'
	  country:{
	      code: 'DK',
              name: 'Dinamarca',
            }    
        },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/mdEXpGP

Destination Information

https://content.view-travel.com/v1/api/destination/      /* Production environment */
https://tests.view-travel.com/v1/api/destination/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by destination code

language_code

YES

string

Values (es,en,pt)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let code = 'LIM';
	
let params = new URLSearchParams(`code=${code}`);
			
if (language_code != '') {
	params.set('language_code', language_code);
}

if (page != '') {
    params.set('page', page);
}

params.set('order_by', order_by);
			
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/destination/?${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) => { render_destinations(response) });
  • Response success
{
    code: 'LIM',
    name: 'Lima',
   what_to_see: '

what_to_see

'
,
    what_to_do: '

what_to_do

',
    what_to_buy:'

what_to_buy

',
    what_to_eat:'

what_to_eat

',
    coordinates: {         latitude: '41.385064', longitude: '2.173403',     }, description: '

     Lima es....

',
}

https://codepen.io/lenines/full/zYBXdQL

Hotel Type of Services

https://content.view-travel.com/v1/api/hotel-type-of-services/      /* Production environment */
https://tests.view-travel.com/v1/api/hotel-type-of-services/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

language_code

YES

string

Values (es,en,pt)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let language_code = 'es';

let params = new URLSearchParams(`query=${query}`);
			
if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/hotel-type-of-services/?${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) => { });
  • Response success
{
    count: 18,
    pege_numbers:[1],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/hotel-type-of-services/?language_code=es',   previous: null,
   },      
    type_of_services: [
         {
           id: 1,
	         name: 'Exteriores',   
            icon: 'store',    
        },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/BazgLaq

Hotel Services

https://content.view-travel.com/v1/api/hotel-services/      /* Production environment */
https://tests.view-travel.com/v1/api/hotel-services/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

type_of_service

NO

string

Type of service id (see List hotels type of services)

language_code

YES

string

Values (es,en,pt)

queryNO
string
Find by service name                     
  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let query = '',
    type_of_service = 1,
    language_code = 'es';

let params = new URLSearchParams(`query=${query}`);
			
if (type_of_service != '') {
    params.set('type_of_service', type_of_service);
}
if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/hotel-services/?${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) => { });
  • Response success
{
    count: 148,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/hotel-services/?page=2&language_code=es&order_by=name';
        previous: null,
   },      
    services: [
         {
           id: 1,
	         name: 'Mobiliario exterior',   
            type_of_service: {
              id: 1,
	          name: 'Exteriores',
	          icon: 'store'   
        },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/mdEZrrK

Hotels

https://content.view-travel.com/v1/api/hotels/      /* Production environment */
https://tests.view-travel.com/v1/api/hotels/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

country_code

YES

string

Country code (see List of destinations)

destination_code

YES

string
Destination code
language_code

YES

string

Values (es,en,pt)

query
NOstring
Find by hotel name
  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let query = '',
    country_code = 'PE',
    destination_code = 'LIM',
    language_code = 'es';

let params = new URLSearchParams(`query=${query}`);
			
if (country_code != '') {
    params.set('country_code', country_code);
}
if (destination_code != '') {
    params.set('destination_code', destination_code);
}
if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/hotels/?${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) => { });
  • Response success
{
    count: 748,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/hotels/?page=2&language_code=es&order_by=name';
        previous: null,
   },      
    hotels: [
         {
           code: 'pBJ6PGi7TeLz',
	   name: '151 Backpacker Hostel B&B',   
            city: {
               code: 'LIM',
	      name: 'Lima'
	      country:{
	          code: 'PE',
                     name: 'Peru',
                }    
        },
        {
           code: 'hyxCjsrUrXSp',
	   name: '1900 Hostel',   
            city: {
               code: 'LIM',
	      name: 'Lima'
	      country:{
	          code: 'PE',
                     name: 'Peru',
                }    
      },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/RwRdZNO

Hotel Information

https://content.view-travel.com/v1/api/hotel/      /* Production environment */
https://tests.view-travel.com/v1/api/hotel/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by hotel code

language_code

YES

string

Values (es,en,pt)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let code = 'JZmGml6pAuep',
    language_code = 'es';
let params = new URLSearchParams(`code=${code}`);
			
if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/hotel/?${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) => { });
  • Response success
{
    code: 'JZmGml6pAuep',
    name: 'Sunlight Bahia Principe Coral Playa',
   stars: 3,
    hotel_address:'Torrenova, 41, 07181 Magaluf, España',
    city: {	
        code: 'GTR',
        name: 'Magaluf',
        country: {
	code: 'ES',
          name: 'España',
        }
    },
   description: '

        Este alojamiento está a 1 minuto a pie de la playa. El Bahía Príncipe Coral         Playa, situado sobre una colina con vistas a la bahía de Magalluf,         dispone de acceso a la playa en ascensor. Tiene piscina al aire         libre.

Las habitaciones del Bahía Príncipe Coral Playa        son luminosas y cuentan con aire acondicionado, minibar y TV de         pantalla plana con canales vía satélite. Además, se proporciona caja         fuerte por un suplemento. Muchas habitaciones tienen terraza privada y         gozan de vistas al mar. Se facilita WiFi por un         suplemento.

El restaurante buffet del Bahía sirve         comida internacional. También hay un bar junto a la         piscina.

El Coral Playa está situado a 5 minutos a pie        del centro de Magalluf, a 14 km de Palma y a 25 km del aeropuerto.

',
   coordinates: { latitude : '39.4917797366084', longitude: '2.51860871879518', }, type_of_service: [ {     id : 1,               name    : 'Exteriores',            icon    : 'pool',               services : [                 {                   id    : 2,                   name  : 'Terraza / solárium',          },                                         .                                ]      },   .             .            .     ], }

https://codepen.io/lenines/full/MWeLJKK

Hotels by proximity

https://content.view-travel.com/v1/api/hotels-by-proximity/      /* Production environment */
https://tests.view-travel.com/v1/api/hotels-by-proximity/    /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

query
YES
string
Find by hotel name 
distance
YES
float
(0.1, 0.2, 0.3, 0.4, ..... 1, 2, 3, 4, 5) km.
latitude

YES

string

Latitude hotel

longitudeYES
string
Longitude hotel
language_code

YES

string

Values (es,en,pt)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let query = 'hotel name',
    latitude = '35.8796962656124',
  	 longitude = '-5.32990872859955',
     distance = 1,
     language_code = 'es';
  
let params = new URLSearchParams(`query=${query}`);
  
if (latitude != '') {
      params.set('latitude', latitude);
}
  
if (longitude != '') {
      params.set('longitude', longitude);
}
  
if (distance != '') {
      params.set('distance', distance);
}
  
if (language_code != '') {
      params.set('language_code', language_code);
}
  
let queryString = params.toString()
let url = new URL(`https://view-travel.com/v1/api/hotels-by-proximity/?${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) => { });
  • Response success
[{
    code: 'JZmGml6pAuep',
    name: 'Sunlight Bahia Principe Coral Playa',
   stars: 3,
    hotel_address:'Torrenova, 41, 07181 Magaluf, España',
    city: {	
        code: 'GTR',
        name: 'Magaluf',
        country: {
	code: 'ES',
          name: 'España',
        }
    },
   description: '

        Este alojamiento está a 1 minuto a pie de la playa. El Bahía Príncipe Coral         Playa, situado sobre una colina con vistas a la bahía de Magalluf,         dispone de acceso a la playa en ascensor. Tiene piscina al aire         libre.

Las habitaciones del Bahía Príncipe Coral Playa        son luminosas y cuentan con aire acondicionado, minibar y TV de         pantalla plana con canales vía satélite. Además, se proporciona caja         fuerte por un suplemento. Muchas habitaciones tienen terraza privada y         gozan de vistas al mar. Se facilita WiFi por un         suplemento.

El restaurante buffet del Bahía sirve         comida internacional. También hay un bar junto a la         piscina.

El Coral Playa está situado a 5 minutos a pie        del centro de Magalluf, a 14 km de Palma y a 25 km del aeropuerto.

',
   coordinates: { latitude : '39.4917797366084', longitude: '2.51860871879518', }, type_of_service: [ {     id : 1,               name    : 'Exteriores',            icon    : 'pool',               services : [                 {                   id    : 2,                   name  : 'Terraza / solárium',          },                                         .                                ]      },   .             .            .     ], },]

https://codepen.io/lenines/full/MWJYENM

Shipping Fleet

https://content.view-travel.com/v1/api/shipping-fleets/      /* Production environment */
https://tests.view-travel.com/v1/api/shipping-fleets/     /* Test environment */             
  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let url = new URL(`https://view-travel.com/v1/api/shipping-fleets/`);

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) => { });
  • Response success
{
    count: 63,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://mediafiles.view-travel.com/v1/api/shipping-fleets/?page=2';
        previous: null,
   },      
    shipping_fleets: [
         {
           code: 'CSS',
	   name: 'Aclass Cruises',  
        },
        {
           code: 'AID',
	   name: 'Aida Cruises',  
      },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/pen/NWrQBXw

Boats

https://content.view-travel.com/v1/api/boats/      /* Production environment */
https://tests.view-travel.com/v1/api/boats/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

language_code

YES

string

Values (es,en,pt)

query
NOstring
Find by boat name
shipping_fleet_codeNO
string

Shipping Fleet code (see List of shipping fleet)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let query = '',
    language_code = 'es';

let params = new URLSearchParams(`query=${query}`);

if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/boats/?${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) => { });
  • Response success
{
    count: 447,
    pege_numbers:[1,2,3],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://mediafiles.view-travel.com/v1/api/boats/?query=&language_code=es&page=2';
        previous: null,
   },      
    ships: [
         {
           code: 'slaig6tKQzoc',
	   name: 'A Rosa Aqua',  
        },
        {
           code: 'TGmdD1rvkCQ4',
	   name: 'A Rosa Brava',  
      },
        .
        .
      .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/ZEOgoZW

Boat Information

https://content.view-travel.com/v1/api/boat/      /* Production environment */
https://tests.view-travel.com/v1/api/boat/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by boat code

language_code

YES

string

Values (es,en,pt)

  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';
let code = 'slaig6tKQzoc',
    language_code = 'es';
let params = new URLSearchParams(`code=${code}`);
			
if (language_code != '') {
    params.set('language_code', language_code);
}
	
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/boat/?${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) => { });
  • Response success

{
    code: 'slaig6tKQzoc',
    name: 'A Rosa Aqua',
    shipping_fleet: {	
        code: 'PAN',
        name: 'Panavision Fluviales',
    },
   description: 'El barco\r\nEl A-ROSA Aqua fue '

,

}

https://codepen.io/lenines/full/QWEexGj

Photos

https://content.view-travel.com/v1/api/photos/      /* Production environment *
https://tests.view-travel.com/v1/api/photos/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by code of destination, hotel, boat

type_photo

YES

string
Destination, hotel, boat

page

Only when you need to return more than 6 results

integer


  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let code = 'BCN',
     type_photo = 'destination',
    page = 1;
let params = new URLSearchParams(`code=${code}`);
			
if (type_photo != '') {
    params.set('type_photo', type_photo);
}
			
if (page != '') {
    params.set('page', page);
}
		
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/photos/?${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) => { render_destinations(response) });
  • Response success
{
    count: 1,
    pege_numbers:[1,2],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/photos/?code=BCN&page=1&type_photo=destination';
        previous: null,
   },      
    photos: [
        {
           small: 'https://staticfiles.view-travel.com/destinos/inspiravia/photos/viewtravel-5640.jpg',
	  median: 'https://staticfiles.view-travel.com/destinos/inspiravia/photos/viewtravel-m-5640.jpg',
             big: 'https://staticfiles.view-travel.com/destinos/inspiravia/photos/viewtravel-l-5640.jpg',
        },
        .
        .
        .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/rNLbGWq

Videos

https://content.view-travel.com/v1/api/videos/      /* Production environment */
https://tests.view-travel.com/v1/api/videos/     /* Test environment */             
  • List of parameters 

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

code

YES

string

Find by code of destination, hotel, boat

type_video

YES

string
Destination, hotel, boat

page

Only when you need to return more than 6 results

integer


is_activity
Only apply for destinations
boolean
true or false
  • This is an example request using javascript fetch

const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f';

let code = 'BCN',
     type_video = 'destination',
    page = 1,
    is_activity = true;
let params = new URLSearchParams(`code=${code}`);
			
if (type_video != '') {
    params.set('type_video', type_video);
}
			
if (page != '') {
    params.set('page', page);
}

if (is_activity != '') {
   params.set('is_activity', is_activity);
}
			
let queryString = params.toString();

let url = new URL(`https://view-travel.com/v1/api/videos/?${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) => { render_destinations(response) });
  • Response success
{
    count: 1,
    pege_numbers:[1,2],
   back_page_number: null,
   exist: true,
   links: {
       next:'https://view-travel.com/v1/api/videos/?code=BCN&page=1&type_video=destination';
        previous: null,
   },      
    videos: [
        {
           code: 'zQFEjTSxHpFY',
	  title: 'Conocer Barcelona en 2 dias I que hacer gratis en Barcelona',
             video_url: 'https://mediafiles.view-travel.com/video/?v=0dicG4WZFxJR&vca=bLjIwBKwUsfQjotbpWPXo2RII2IrtlN3',
            iframe: "",
        },
        .
        .
        .		
   ],
   exist_back: false,
    next_page_number: 2,
   page_current: 1
} 

https://codepen.io/lenines/full/gOMQxPg

Travellers

  • Request urls API
https://view-travel.com/v1/api/search-travellers/      /* Production environment */
https://tests.view-travel.com/v1/api/search-travellers/    /* Test environment */

List of parameters to search traveller

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

query

NO

string

name, username, email

start_dateNOstringdd/MM/yyyy
end_date
NO
string
dd/MM/yyyy
language_codeSIstringLanguage 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/search-travellers/?${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_travellers: 120,

    2. back_page_number: null,

    3. exist: true,
    4.     
    5. .
  1.        .
  2.        .






}

Advance example Search Travellers