Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
let params = {
    'title': 'Lima - Bogota - Mexico - Madrid - Barcelona',
    'text': '',
    'departure': 'LIM',
    'destinations': 'BOG,MEX,MAD,BCN',
    'price': '',
    'departure_date': '21/03/2020',
    'arrival_date': '30/03/2020',
    'background_video': true,
    'background_photo': false,
    'type_view': 'Destination',
    'is_closed': false,
    'hotels': '12306,8251,23601',
    'automatic': true,
    'is_active': true,
    'price_from': true,
 }
const token = 'Token INSERT_YOUR_TOKEN';
const code = 'xEz6hI3m';
let url_edit = 'https://tests.view-travel.com/v1/api/view/' + code;
fetch(url_edit, {
    method: 'PUT',
    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));  
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers