Documentation
VPT API 1.0
The API VPT provides programmatic access to read and write VPT data. Review our products and its data (departure dates, cities, countries, hotels and more), make reservations and review reservations already made, create users and assign user's permissions, and more. Highlights:
- Login will be make in every request
- Request and responses will be in JSON format
- There is no rate limit
- Product is right now in beta, so minor changes are expectable
overview
- Product structure
- Request structure
- Working example
- Get access
product structure
VPT mainly sells organized tours around Europe and sighseeing tours around Madrid. These tours are structured inside brochures, which are included inside catalogs. Each client could get into catalogs depending his language and his localization.
- Spain - Portugal - Morocco [catalog]
- Days tour [brochure]
- Andalucia & Toledo [tour]
- Green Spain [tour]
- Departures from Barcelona [brochure]
- Andalucia & Valencia [tour]
- North of Spain [tour]
- Days tour [brochure]
Regarding reservations, when you book a tour (service) you get two numbers:
- Reservation locator: the locator of the reservation which includes your service
- ReservationService locator: the locator of the service you've just book
So, reservations could include various reservationServices. This is useful to group services for the same passengers.
request structure
For every request you make you will have to post a JSON Object named --in-- to an endpoint containing the following arrays:
- logindata:
- useremail: the email of the user who makes the call
- userpass: the password of the user
- requestdata: containing different fields depending the endpoint called
- field1
- field2
- ...
working example
This is a working example using HTML and PHP to make a call to the getcatalogs endpoint.
request
$datos = array (
'logindata' => array (
'useremail' => 'johndoe@whatever.com',
'userpass' => 'johndoepass'
),
'requestdata' => array (
'language' => 1
)
);
$datos = json_encode ($datos);
echo "<form action='http://api.vpttours.com/getcatalogs' method='post'>";
echo "<input type='hidden' name='in' value='$datos' />";
echo '<input type="submit" name="go" value="go">';
echo "</form>";
response
{
"1": {
"code": "201412",
"name": "Circuitos por Europa y Oriente Medio",
"startdate": "2015-04-01",
"enddate": "2015-10-31",
"brochures": [
"24",
"25",
"26",
"27",
"28"
]
},
"2": {
"code": "201414",
"name": "Circuitos por Europa y Oriente Medio",
"startdate": "2015-11-01",
"enddate": "2016-03-31",
"brochures": [
"31",
"32",
"33",
"34",
"35",
"36"
]
},
"3": {
"code": "201410",
"name": "España Portugal & Marruecos",
"startdate": "2015-04-01",
"enddate": "2016-03-31",
"brochures": [
"22"
]
}
}
get access
So, ask for access right now and start coding!!