Import Booking to View

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

List of parameters to create the view

PARAMETERS

MANDATORY

TYPE

VALUES THAT CAN BE TAKEN 

departure

YES

string

Departure city code (see "list of exist point parameters" in help manuals) accept IATA Code

destination

YES

string

Destination city code (see "list of exist point parameters" in help manuals) accept IATA Code

transport_type
Only if you want to show the means of transport integer
Transport type ids (see "list of exist point parameters" in help manuals) 
airlineOnly for flights
string
Code IATA (see "list of exist point parameters" in help manuals) accept IATA Code
flight_number
Only if you want to show the flight_number
string

flight_class
Only if you want to show the flight_class
integer
Flight class (see "list of exist point parameters" in help manuals) 
ship
Only for cruisesinteger
Ship (see "list of exist point parameters" in help manuals) 
staterooms
Only for cruises
integer
Staterooms  (see "list of exist point parameters" in help manuals) 
departure_date
NO
string
dd/MM/yyyy
arrival_date
NO
string
dd/MM/yyyy
departure_time
NO
string
H:ss
arrival_time
NO
string
H:ss
price
NOfloat

order
default takes the order of the last record plus 1
integer

comment
NO
stringe.g. insert transport & hotel fare rules 

  • This is an example request using javascript fetch

let params = {
  'departure': 'LIM'
  'destination': 'BOG',
  'transport_type': 1,
  'airline': 'LF',
  'flight_number': 'BH01902',
  'flight_class': 2,
  'departure_date': '27/03/2021',
  'arrival_date':'27/03/2021',
  'departure_time': '13:30',
  'arrival_time': '15:30',
  'price': 300,
  'order': 1,
  'comment': 'MESSAGES',
  'is_active': true  
}
const token = 'Token 23c618d5becf741d264c8d92a61adfce9db6f43f'; const code = '7ZAFk5Dt'; let url_api = 'https://tests.view-travel.com/v1/api/bookings/' + code; // code of view fetch(url_api, { method: 'post', credentials: 'same-origin', headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }, 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

Edit Booking

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