# Locators
You can use the /v2/locators
endpoints to manage the locators for your organization.
# The locator object
Attributes
no_results hash
Define how it would look like if there is no results.
+ Show child attributes
no_results. button hash
Options for the button.
+ Show child attributes
no_results.button. label string
Button label.no_results.button. link string
Button link.
no_results. message string
Message if no results.
back_button hash
Options for the back button.
+ Show child attributes
back_button. label string
Button label.
geolocation boolean
Whether or not to show a Geolocation button on the address field._id string
Unique identifier for the locator.handle string
A unique identifier that let you access the locator at
https://vyte.in/locators/:handle
org string
The
id
of your organization.postcode_filter string
A Regex to restrain the adress to certain postcodes.
address_postfix string
An address part which will be added automatically to the address (for example, the country)address_region_bias string
Used by Google API to restrict auto-completion proposals to a certain area.lang string
Language for the locator. It is expressed according to ISO 639-1 and the available languages are :
fr
,en
,es
,it
,pt
,de
,sv
,nl
. Default isen
.max_distance number
Maximum distance (in meters) around the locations.
message string
Message shown on the locator page.
title string
Title on the locator page.
THE LOCATOR OBJECT
{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"_id": "5ef9f3a3993a4d632a5c84f1",
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"postcode_filter": "",
"address_postfix": "England",
"address_region_bias": "en",
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "Available locations"
}
# List all locators
ENDPOINT Authorization
apiKey
GET /v2/locators HTTP/1.1
Path parameters
No parameters.
Query parameters
No parameters.
Returns
Returns an array of Locator
objects if there is some existing locators. Otherwise, returns an empty array.
CODE SAMPLE
curl --request GET 'https://api.vyte.in/v2/locators' \
--header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
RESPONSE SAMPLE
[
{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"_id": "5ef9f3a3993a4d632a5c84f1",
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"_v": 0,
"postcode_filter": "",
"address_postfix": "England",
"address_region_bias": "en",
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "Available locations"
}
]
# Retrieve a locator
ENDPOINT Authorization
apiKey
GET /v2/locators/:handle HTTP/1.1
Path parameters
handle string required
The
handle
of the locator.
Query parameters
No parameters.
Returns
Returns a Locator
object if a valid handle was provided, and returns an error otherwise.
CODE SAMPLE
curl --request GET 'https://api.vyte.in/v2/locators/my-locator' \
--header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0'
RESPONSE SAMPLE
{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"_id": "5ef9f3a3993a4d632a5c84f1",
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"_v": 0,
"postcode_filter": "",
"address_postfix": "England",
"address_region_bias": "en",
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "Available locations"
}
# Create a locator
ENDPOINT Authorization
apiKey
POST /v2/locators HTTP/1.1
Path parameters
No parameters.
Query parameters
No parameters.
Body parameters
no_results hash
Define how it would look like if there is no results.
+ Show child attributes
no_results. button hash
Options for the button.
+ Show child attributes
no_results.button. label string
Button label.no_results.button. link string
Button link.
no_results. message string
Message if no results.
back_button hash
Options for the back button.
+ Show child attributes
back_button. label string
Button label.
geolocation boolean
Whether or not you to activate the around me feature.handle string required
A unique identifier set by yourself. The namespace is global for all the organizations so the
handle
must be unique in the global namespace.postcode_filter string
If you want to restrain the adress to a certain Postcode.address_postfix string
An address part which will be added automatically to the address (for example, the country)address_region_bias string
Used by Google API to restrict auto-completion proposals to a certain area.lang string
Language for the locator. It is expressed according to ISO 639-1 and the available languages are :
fr
,en
,es
,it
,pt
,de
,sv
,nl
. Default isen
.max_distance number
Maximum distance around the locations (in meters).
message string
Message shown on the locator page.
title string
Title on the locator page.
Returns
Returns the created Locator
object if a valid handle was provided, and returns an error otherwise.
CODE SAMPLE
curl --request POST 'https://api.vyte.in/v2/locators' \
--header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
--header 'Content-Type: application/json' \
--data-raw '{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "Available locations"
}'
RESPONSE SAMPLE
{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"_id": "5f0f64e22003d0340e2a9624",
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"__v": 0,
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "Available locations"
}
# Update a locator
ENDPOINT Authorization
apiKey
POST /v2/locators/:locator_id HTTP/1.1
Path parameters
locator_id string required
The
_id
of the locator. Be careful, this is not thehandle
but the_id
given by Vyte to the locator.
Query parameters
No parameters.
Body parameters
no_results hash
Define how it would look like if there is no results.
+ Show child attributes
no_results. button hash
Options for the button.
+ Show child attributes
no_results.button. label string
Button label.no_results.button. link string
Button link.
no_results. message string
Message if no results.
back_button hash
Options for the back button.
+ Show child attributes
back_button. label string
Button label.
geolocation boolean
Whether or not you to activate the around me feature.handle string
A unique identifier set by yourself. The namespace is global for all the organizations so the
handle
must be unique in the global namespace.postcode_filter string
If you want to restrain the adress to a certain Postcode.address_postfix string
An address part which will be added automatically to the address (for example, the country)address_region_bias string
Used by Google API to restrict auto-completion proposals to a certain area.lang string
Language for the locator. It is expressed according to ISO 639-1 and the available languages are :
fr
,en
,es
,it
,pt
,de
,sv
,nl
. Default isen
.max_distance number
Maximum distance around the locations (in meters).
message string
Message shown on the locator page.
title string
Title on the locator page.
Returns
Returns the created Locator
object if a valid handle was provided, and returns an error otherwise.
CODE SAMPLE
curl --request PUT 'https://api.vyte.in/v2/locators/5f0f64e22003d0340e2a9624' \
--header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "This is my first locator."
}'
RESPONSE SAMPLE
{
"no_results": {
"button": {
"label": "Label",
"link": "https://vyte.com"
},
"message": "There is no locations available."
},
"back_button": {
"label": "Back to locator"
},
"geolocation": false,
"_id": "5f0f64e22003d0340e2a9624",
"handle": "my-locator",
"org": "5ef0cb128f284274b2361323",
"__v": 0,
"lang": "en",
"max_distance": 150000,
"message": "Find on of our locations around you for the meeting.",
"title": "This is my first locator."
}
# Delete a locator
ENDPOINT Authorization
apiKey
DELETE /v2/locators/:locator_id HTTP/1.1
Path parameters
locator_id string required
The
_id
of the locator. Be careful, this is not thehandle
but the_id
given by Vyte to the locator.
Query parameters
No parameters.
Returns
Returns an object containing the number of row affected and the status if there is no error, and returns an error otherwise.
CODE SAMPLE
curl --request DELETE 'https://api.vyte.in/v2/locators/5f0f64e22003d0340e2a9624' \
--header 'Authorization: vkjvi2bvfo54ssbybmcts0x42z1sbzm6t0mot8trh8i03reno0' \
RESPONSE SAMPLE
{
"n": 1,
"ok": 1
}