Create VideoView

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

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

title

YES

string

Title with which you want to present the view

destinations

YES

string

City codes separated by commas (see "list of destinations" in help manuals)

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': '12306,8251,23601',
	  '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': '12306,8251,23601',        'boats': '120,121,122',     'shipping_company': 40,
    'code': 'q13pQY7EPEufEwJC',             'title': 'Lima - Barcelona',
    'destinations': 'MEX,MAD,BCN',   }, 'videoview_url':'https://tests.view-travel.com/watch?code=q13pQY7EPEufEwJC' }

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


Edit VideoView


https://view-travel.com/api/videoview/      /* Production environment */
https://tests.view-travel.com/api/videoview/     /* Test environment */             
  • This is an example request using javascript fetch
let params = {
      'title': 'Lima - Barcelona - modify',
	  'destinations': 'MEX,MAD,BCN',
	  'hotels': '12306,8251,23601',
	  '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': '12306,8251,23601',        '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?editors=0012


VideoView fullscreen to the iframe

https://tests.view-travel.com/watch?code=q13pQY7EPEufEwJC
If you want the background videoview to be able to be viewed in full screen, add the following settings to the iframe:

allowfullscreen="true" webkitallowfullscreen="true" mozallowfullscreen="true"