Request urls API | Method PUT

[<https://content.view-travel.com/v3/api/transports/><id>/](<https://content.view-travel.com/v3/api/transports/><id>/)

There are a variety of transport types. In this example, we'll take flight. List of parameters for creating the transports. The flight transport type

PARAMETERS MANDATORY TYPE VALUES THAT CAN BE TAKEN
title NO string Title with which you wish to create the transport
my_view YES string view code to which you want to add transports
transport_type YES string Transport type code see list of transport type codes
origin YES string City IATA code see list of IATA codes
arrival YES string City IATA code see list of IATA codes
departure_date NO string Flight departure date in the format "yyyy-mm-dd”
departure_time Flight departure time in the format "HH:MM”
arrival_date NO string Flight arrival date in the format "yyyy-mm-dd”
arrival_time NO string Flight arrival time in the format "HH:MM”
airline NO string Airline id or airline code
flight_number NO string Flight number
flight_class NO string Flight class
photo NO integer
video NO integer
description NO string Description with which you want to present the view
price Only when no price package is used float Price of your offer

Include in headers

headers: {
		'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': Bearer YOUR_TOKEN_REFRESH' ,
}

Alll parameters to send the request

{
    "title": "Viewtravel V3",
    "subtitle": "Sub title of Viewtravel",
    "description": "Description your trip",
    "type_view": "destination",
    "is_videoview": true,
    "thematic": 430,
    .
    .
    .
}

Response to the request

{
    "id": 3783,
    "package_code": "ONE",
    "title": null,
    "my_view": {
        "code": "AFBB29B72B0C",
        "title": "Viewtravel V3",
        "subtitle": "Sub title of Viewtravel",
        "type_view": "destination",
        "thematic": {
            "id": 430,
            "name": "Bali Spa",
            "group": {
                "id": 10,
                "name": "Relax"
            }
        },
        "description": "Description your trip",
        "is_photoview": true,
        "is_videoview": false,
        "agency": {
            "id": 8,
            "name": "Viewtravel Custom"
        },
        "user": {
            "id": 615,
            "first_name": "Lenin",
            "last_name": "Espinoza Cueva",
            "email": "[email protected]",
            "username": "leninesc"
        },
        "price": null,
        "currency": null,
        "reservation_number": null,
        "ticket_issued": null,
        "theme": {
            "id": 1,
            "name": "Viewtravel Version 3"
        },
        "is_active": true,
        "is_new": true,
        "edit_url": "<https://view-travel.com/allinone/edit/AFBB29B72B0C>",
        "url_mytrip": "<https://view-travel.com/mytrip/AFBB29B72B0C>"
    },
    "origin": {
        "id": 926,
        "code": "MEX",
        "name": "Ciudad de Mexico",
        "country": {
            "id": 147,
            "code": "MX",
            "name": "Mexico",
            "prefix_code": "52"
        },
        "citydescription": {
            "id": 266,
            "short_description": "La Ciudad de México, es una de las 32 entidades federativas de México, así como la capital de los Estados Unidos Mexicanos. Se localiza en el Valle de México, a una altitud media de 2,240 msnm. Tiene una superficie de 1,495 km, y se divide administrativamente en 16 delegaciones. Su población es de 8.9 millones de habitantes aproximadamente. Sin embargo, cuando se considera también la Zona Metropolitana del Valle de México, suma entonces una población total de más de 21 millones de habitantes, lo que la coloca en el noveno puesto de las aglomeraciones urbanas más grandes y más pobladas del mundo, y con ello la más grande del continente americano y del mundo hispanohablante."
        }
    },
    "arrival": {
        "id": 2668,
        "code": "MAD",
        "name": "Madrid",
        "country": {
            "id": 60,
            "code": "ES",
            "name": "España",
            "prefix_code": "34"
        },
        "citydescription": {
            "id": 748,
            "short_description": "Madrid es un municipio y ciudad de España. Es la capital del Estado y de la Comunidad de Madrid. La ciudad, que tiene categoría histórica de villa, es también conocida como la Villa y Corte. Dentro del término municipal de Madrid, el más poblado de España, viven 3 182 981 personas empadronadas, según el INE de 2017. El área metropolitana de Madrid tiene una población de 6 543 031 habitantes, por lo que es la tercera o cuarta área metropolitana de la Unión Europea, según la fuente, por detrás de las de París y Londres, y en algunas fuentes detrás también de la Región del Ruhr, así como la tercera ciudad más poblada de la Unión Europea, por detrás de Berlín y Londres."
        }
    },
    "photo": null,
    "transport_type": {
        "id": 6,
        "code": "flight",
        "name": "Vuelo",
        "icono": "<i class=\\"fa fa-plane fa-lg\\" aria-hidden=\\"true\\"></i>",
        "imagen": "<http://localhost:8000/media/transportes/airport.png>",
        "icon": "<svg class=\\"h-4 w-4\\" xmlns=\\"<http://www.w3.org/2000/svg\\>" viewBox=\\"0 0 640 512\\">\\r\\n                <path\\r\\n                  d=\\"M256 0c-35 0-64 59.5-64 93.7v84.6L8.1 283.4c-5 2.8-8.1 8.2-8.1 13.9v65.5c0 10.6 10.2 18.3 20.4 15.4l171.6-49 0 70.9-57.6 43.2c-4 3-6.4 7.8-6.4 12.8v42c0 7.8 6.3 14 14 14c1.3 0 2.6-.2 3.9-.5L256 480l110.1 31.5c1.3 .4 2.6 .5 3.9 .5c6 0 11.1-3.7 13.1-9C344.5 470.7 320 422.2 320 368c0-60.6 30.6-114 77.1-145.6L320 178.3V93.7C320 59.5 292 0 256 0zM640 368a144 144 0 1 0 -288 0 144 144 0 1 0 288 0zm-76.7-43.3c6.2 6.2 6.2 16.4 0 22.6l-72 72c-6.2 6.2-16.4 6.2-22.6 0l-40-40c-6.2-6.2-6.2-16.4 0-22.6s16.4-6.2 22.6 0L480 385.4l60.7-60.7c6.2-6.2 16.4-6.2 22.6 0z\\" />\\r\\n</svg>",
        "icono_rojo": "<http://localhost:8000/media/transportes/rojo/airport.png>",
        "is_old": true,
        "divider": false,
        "is_hidden": false,
        "orden": 1,
        "new_order": 3
    },
    "airline": null,
    "flight_number": null,
    "flight_class": null,
    "other_value": null,
    "departure_date": null,
    "arrival_date": null,
    "departure_time": null,
    "arrival_time": null,
    "price": null,
    "order": 1,
    "dnd_order": 1,
    "comment": null,
    "is_active": true,
    "name": null,
    "video": null,
    "description": null,
    "supplements": [],
    "slug": "3783",
    "user": {
        "id": 615,
        "first_name": "Lenin",
        "last_name": "Espinoza Cueva",
        "email": "[email protected]",
        "username": "leninesc"
    }
}