Appearance
/location-links
Retrieve links to the location search pages of various providers.
Endpoint URL
https://partners.api.vio.com/v1/location-links
HTTP Method
POST
Headers
| Name | Required | Description |
|---|---|---|
X-Partner-Key | Yes | Partner's profile key |
Content-Type | Yes | application/json |
Accept-Encoding | No | gzip, deflate, br |
Request body
API Parameters
| Name | Required | Type | Description | Example Query | Default value |
|---|---|---|---|---|---|
query | No | string | Free-text query. Either query or place is required. | Amsterdam city | |
checkIn | No | string | Check in date (YYYY-MM-DD). | 2023-05-10 | |
checkOut | No | string | Check out date (YYYY-MM-DD). | 2023-05-11 | |
rooms | No | string | See Rooms configuration. | 2:4,6 | 2 |
language | Yes | string | See supported languages. | es | |
currency | Yes | string | See supported currencies. Must be a 3-char ISO 4217 code. | USD | |
anonymousId | No | string | Anonymous user identifier. | e0775301-a95a-4b56-a727-9cec40a013af | |
userDevice | Yes | string | The type of the user's device: desktop, mobile, tablet. | "desktop" | |
userCountry | Yes | string | The 2-char ISO 3166 country code of a user. | "US" | |
vioOnly | No | boolean | Return only Vio.com location links. | ||
label | No | string | Arbitrary string for tracking and reporting. | ||
place | No | jsonObject | Place query object. Either query or place is required. | { "name": "Paris", "country": "France" } |
PlaceQuery Definition
yaml
PlaceQuery:
type: object
properties:
country:
type: string
description: |
Country of the place. Use this parameter to refine the search if there are places (e.g. cities) with the same names in different countries.
name:
type: string
description: The name of the place to query.
required:
- nameDynamic Click Tracking
Click tracking is available using Dynamic Click Tracking
Example
bash
curl --request POST 'https://partners.api.vio.com/v1/location-links' \
--header 'X-Partner-Key: partner-profile-key' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "ES",
"userDevice": "mobile",
"query": "Madrid, Spain"
}'
curl --request POST 'https://partners.api.vio.com/v1/location-links' \
--header 'X-Partner-Key: partner-profile-key' \
--header 'Content-Type: application/json' \
--data-raw '{
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "GB",
"userDevice": "desktop",
"place": {
"name": "Madrid",
"country": "Spain"
}
}'js
const url = "https://partners.api.vio.com/v1/location-links";
const key = "partner-profile-key";
const requestBody = {
checkIn: "2023-03-19",
checkOut: "2023-03-20",
rooms: "2",
language: "en",
currency: "EUR",
userCountry: "NL",
userDevice: "mobile",
query: "Madrid, Spain",
};
const headers = {
"Content-Type": "application/json",
"X-Partner-Key": key,
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(requestBody),
})
.then((response) => {
if (!response.ok) {
throw new Error("Network response was not ok");
}
return response.json();
})
.then((data) => console.log(data))
.catch((error) => console.error(error));py
import requests
url = "https://partners.api.vio.com/v1/location-links"
key = "partner-profile-key"
request_body = {
"checkIn": "2023-03-19",
"checkOut": "2023-03-20",
"rooms": "2",
"language": "en",
"currency": "EUR",
"userCountry": "ES",
"userDevice": "mobile",
"query": "Madrid, Spain"
}
headers = {
"Content-Type": "application/json",
"X-Partner-Key": key
}
response = requests.post(url, headers=headers, json=request_body)
if response.status_code != 200:
raise Exception("Request failed with status code {}".format(response.status_code))
response_data = response.json()
print(response_data)Response
The response payload has the following fields:
| Field | Type | Description |
|---|---|---|
links | ProviderLinks[] | A List of providers links. |
ProviderLinks
| Field | Type | Description |
|---|---|---|
name | string | Provider's name. |
logo | string | Provider's logo. |
url | string | Book url. |
Example:
ts
{
"name": "Vio.com",
"logo": "https://i.fih.io/provider/svg/fht.svg",
"url": "https://r.vio.com/..."
}Live demos
Redirect banner with location based links
This is an example of how the /v1/location-links endpoint can be used to create an inline banner with redirect links to different providers.