Instructions
Sommaire | ||||
---|---|---|---|---|
|
GET {url}/localtrac/locations | ||||||
---|---|---|---|---|---|---|
This route will return the list of accessiblelocations for the logged user. Locations returned are across every business/account accessible by the current user. The system returns a maximum of 20 locations per page and page requested can be altered via the query parameters. | ||||||
Request | ||||||
Query | ||||||
p (optionnal) | <int> Page to return | |||||
Headers | ||||||
Authorization | <token> obtained during the Authentication | |||||
Accept | application/json | |||||
Response (200) - Success | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
| ||||||
uuid | LOCALTRAC unique identifier (uuid) of the location. This is the uuid you should use for any further request that requires a <location_uuid> within the url. | |||||
name | Name of the location in the language (locale) of the location based on the language field in LOCALTRAC. If the location does not have a name, it will return the Business name. If the location has no language (locale), the French version is returned by default. | |||||
address | One liner address of the location. | |||||
storecode | External id given by the client when the location was created or when imported in LOCALTRAC from a directory. | |||||
active | Boolean value representing the status of the location, true for active and false for inactive. When a location is set as inactive, it is not monitored within any directories. | |||||
Response (403) - Forbidden access | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
|
GET {url}/localtrac/location/<location_uuid> | ||||||
---|---|---|---|---|---|---|
This route returns all location “Information” fields, with the exception of schedule related information. | ||||||
Request | ||||||
Headers | ||||||
Authorization | <token> obtained during the Authentication | |||||
Accept | application/json | |||||
Response (200) - Success | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body (Example) This example is a fake location generated by our test system. | ||||||
|
uuid
LOCALTRAC unique identifier (uuid) of the location. This is the uuid you should use for any further request that requires a <location_uuid> within the url.
storecode
External id given by the client when the location was created or when imported in LOCALTRAC from a directory.
name
Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>.
We currently only support <locale> fr_CA and en_CA.
address
Array containing the full address.
description
Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>.
We currently only support <locale> fr_CA and en_CA.
communication
An associative array for the location contact information.
Supported keys:
contactEmail: primary email address
primaryPhone: primary phone
secondaryPhones: An array of alternative phones. Please note that we currently only accept 2 secondary phones due to directory restrictions
fax: fax number
urls
An associative array for websites and social media URLs.
Supported keys:
website: Main website of the company or location
facebook
twitter
linkedin
instagram
youtube
pinterest
tripadvisor
payments
An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not.
Supported keys:
cash
interact
visa
mastercard
americanExpress
paypass
active
Boolean value representing the status of the location, true for active and false for inactive. When a location is set as inactive, it is not monitored within any directories.
| ||||||
uuid | LOCALTRAC unique identifier (uuid) of the location. This is the uuid you should use for any further request that requires a <location_uuid> within the url. | |||||
storecode | External id given by the client when the location was created or when imported in LOCALTRAC from a directory. | |||||
name | Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>. We currently only support <locale> fr_CA and en_CA. | |||||
address | Array containing the full address. | |||||
description | Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>. We currently only support <locale> fr_CA and en_CA. | |||||
communication | An associative array for the location contact information. Supported keys:
We support a lot of different phone formats, with or without country code. You can set anything with () and - until the total number of numbers does not exceed 20 characters. So, the following formats are accepted:
| |||||
urls | An associative array for websites and social media URLs. Supported keys:
| |||||
payments | An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not. Supported keys:
| |||||
active | Boolean value representing the status of the location, true for active and false for inactive. When a location is set as inactive, it is not monitored within any directories. | |||||
businessKeywords | An array of keywords, associated to business | |||||
keywords | An array of keywords, associated to loaction | |||||
Response (403) - Forbidden access | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
|
POST|PUT {url}/localtrac/location | ||||||
---|---|---|---|---|---|---|
A POST|PUT on this route indicates that you want to create a new location. Each sub key (name, address, description, communication, urls, …) can be updated individually. Any sub key not provided will be ignored and will remain unchanged. | ||||||
Request | ||||||
Headers | ||||||
Authorization | <token> obtained during the Authentication | |||||
Accept | application/json | |||||
Content-Type | application/json | |||||
Body (Example) This example is a fake location generated by our test system. | ||||||
| ||||||
name (optionnal) | Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>. We currently only support <locale> fr_CA and en_CA. | |||||
address (optionnal) | Array containing the full address. | |||||
Response (200) - Success | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
| ||||||
Response (400) - Validation ErrorThis scenario happens if you sent any content who fails the minimum validation process. For instance, providing a wrong business uuid or an empty one would lead to the following result | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
| ||||||
message | Always the same error message, indicating that an error happened during the validation process | |||||
errors | An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data. If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones) | |||||
Response (403) - Forbidden access | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
|
POST {url}/localtrac/location/<location_uuid> | |||||||
---|---|---|---|---|---|---|---|
A POST on this route indicates that you want to update the location fields. Each sub key (name, address, description, communication, urls, …) can be updated individually. Any sub key not provided will be ignored and will remain unchanged. | |||||||
Request | |||||||
Headers | |||||||
Authorization | <token> obtained during the Authentication | ||||||
Accept | application/json | ||||||
Content-Type | application/json | ||||||
Body (Example) This example is a fake location generated by our test system. | |||||||
| |||||||
name (optionnal) | Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>. We currently only support <locale> fr_CA and en_CA. | ||||||
address (optionnal) | Array containing the full address. | ||||||
description (optionnal) | Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>. We currently only support <locale> fr_CA and en_CA. | ||||||
communication (optionnal) | An associative array for the location contact information. Supported keys:
We support a lot of different phone formats, with or without country code. You can set anything with () and - until the total number of numbers does not exceed 20 characters. So, the following formats are accepted:
| ||||||
urls (optionnal) | An associative array for websites and social media URLs. Supported keys:
| ||||||
payments (optionnal) | An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not. Supported keys:
| ||||||
Schedules (optionnal) | An associative array where each key is one day of the week. The value of each key is a range of opening hours with “start” and “end” key for each period within a day. The sub array allows multiple values since a day can be opened and closed multiple times per day.
| ||||||
storeLocatorFields | Array of custom store locator fields. For the moment, only “externalId” key is supported. You can use this field to store any data, associated to location. | ||||||
storeLocatorName | Array of custom translations of the location’s name, used by store locator | ||||||
storeLocatorAddress | Array of custom translations of the locations’s address line. | ||||||
Response (200) - Success | |||||||
Headers | |||||||
Content-type | application/json | ||||||
Cache-Control | no-cache,private | ||||||
Body | |||||||
| |||||||
Response (400) - Validation ErrorThis scenario happens if you sent any content who fails the minimum validation process. For instance, providing a wrong zip code would lead to the following result | |||||||
Headers | |||||||
Content-type | application/json | ||||||
Cache-Control | no-cache,private | ||||||
Body | |||||||
|
POST|PUT {url}/localtrac/location
A POST|PUT on this route indicates that you want to create a new location.
Each sub key (name, address, description, communication, urls, …) can be updated individually. Any sub key not provided will be ignored and will remain unchanged.
Request
Headers
Authorization
<token> obtained during the Authentication
Accept
application/json
Content-Type
application/json
Body (Example)
This example is a fake location generated by our test system.
| ||||||
message | Always the same error message, indicating that an error happened during the validation process | |||||
errors | An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data. If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones) | |||||
Response (403) - Forbidden access | ||||||
Headers | ||||||
Content-type | application/json | |||||
Cache-Control | no-cache,private | |||||
Body | ||||||
|
|
|
name (optionnal)
Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>.
We currently only support <locale> fr_CA and en_CA.
address (optionnal)
|
DELETE {url}/localtrac/location/{locationUuid} | |
---|---|
This route will delete (mark as inactive/deleted) the location. All apiservices externalIds will be cleaned for this location. | |
Request | |
Headers | |
Authorization | <token> obtained during the Authentication |
Accept | application/json |
Response (200) - Success | |
Headers | |
Content- |
Type | application/json |
Cache-Control
Body | ||
|
|
|
| ||
Response ( |
403) - |
Forbidden accessThis scenario happens if you sent |
non-existing locationUuid | |
Content- |
Type | application/json |
Cache-Control
Body | ||
|
|
|
|
message
Always the same error message, indicating that an error happened during the validation process
errors
An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data.
If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones)
Response (403) - Forbidden access
Headers
Content-type
application/json
Cache-Control
no-cache,private
Body
Bloc de code | ||
---|---|---|
| ||
{
"message": "You do not have the required permission to obtain this resource: location(<(string) uuid of the location>)"
} |
POST {url}/localtrac/location/<location_uuid>
A POST on this route indicates that you want to update the location fields.
Each sub key (name, address, description, communication, urls, …) can be updated individually. Any sub key not provided will be ignored and will remain unchanged.
Request
Headers
Authorization
<token> obtained during the Authentication
Accept
application/json
Content-Type
application/json
Body (Example)
This example is a fake location generated by our test system.
language | json |
---|
|
GET {url}/localtrac/location/{locationUuid}/apiservices | |||
---|---|---|---|
This route will return the list of apiservices (directories), associated to location | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
|
|
|
| |||
apiservices | Array of apiservices | ||
apiservices[0].externId | Id of this location within the apiservice | ||
apiservices[0].goToUrl | URL to apiservice location’s page | ||
apiservices[0].slug | Apiservice slug | ||
apiservices[0].uuid | Uuid of the apiservice | ||
Response (403) - Forbidden access | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
|
POST {url}/localtrac/location/{locationUuid}/apiservices | |||
---|---|---|---|
This route will assign location’s external (apiservice) id(s). | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Body (Example) | |||
| |||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response(400) - Validation ErrorThis scenario happens if you sent any content who fails the minimum validation process. For instance, failing to provide valid apiservice name will lead to the following result | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response (403) - Forbidden accessThis scenario happens if you sent non-existing locationUuid | |||
Content-Type | application/json | ||
Body | |||
|
GET {url}/localtrac/location/{locationUuid}/categories/{language} | |||
---|---|---|---|
This route will return the list of apiservice categories, associated to location. For the moment. only “en” and “fr” are supported as a language parameter | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
|
|
|
|
|
|
|
| |||
categories | Array of categories | ||
categories[{apiservice_slug}].primary | Primary category for apiservice (Usually it’s an array of one element). | ||
categories[{apiservice_slug}].secondary | Array of secondary categories | ||
Response (403) - Forbidden access | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
|
|
|
PUT {url}/localtrac/location/{locationUuid}/categories | |||
---|---|---|---|
This route will assign location’s external (apiservice) categories. | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Body (Example) | |||
| |||
{apiservice_slug} | Array of categories for this apiservice. apiservice_slug = bing in the example. | ||
{apiservice_slug}.primary | Array of primary categories for this apiservice (usually it’s an array of one element). You should pass uuid of category, obtained from “search categories” route. | ||
{apiservice_slug}.secondary | Array of secondary categories for this apiservice. You should pass uuid of categories, obtained from “search categories” route. | ||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
|
|
|
name (optionnal)
Array of all the location name translations. Each row of the sub array is an associative value of <locale> : <name>.
We currently only support <locale> fr_CA and en_CA.
address (optionnal)
Array containing the full address.
description (optionnal)
Array of all the location descriptions. Each row of the sub array is an associative value of <locale> : <description>.
We currently only support <locale> fr_CA and en_CA.
communication (optionnal)
An associative array for the location contact information.
Supported keys:
contactEmail: primary email address
primaryPhone: primary phone
secondaryPhones: An array of alternative phones. Please note that we currently only accept 2 secondary phones due to directory restrictions
fax: fax number
urls (optionnal)
An associative array for websites and social media URLs.
Supported keys:
website: Main website of the company or location
facebook
twitter
linkedin
instagram
youtube
pinterest
tripadvisor
payments (optionnal)
An associative array of payment methods. The value is a Boolean, true when payment method is accepted or false when it’s not.
Supported keys:
cash
interact
visa
mastercard
americanExpress
paypass
Schedules (optionnal)
An associative array where each key is one day of the week. The value of each key is a range of opening hours with “start” and “end” key for each period within a day. The sub array allows multiple values since a day can be opened and closed multiple times per day.
If nothing is provide for a day, this means the day is closed
If array with “start: null” and “end: null” is provided, this means the day is closed
If “start: HH:ii” and “end: HH:ii” is provided, this interval will be considered open. Multiple interval can be provided.
Response (200) - Success
Headers
Content-type
application/json
Cache-Control
no-cache,private
Body
Bloc de code | ||
---|---|---|
| ||
{
"name": "Name updated",
"address": "Address updated",
"description": "Description updated",
"communication": "Communication updated",
"urls": "Urls updated",
"payments": "Payments updated"
} |
Response (400) - Validation Error
This scenario happens if you sent any content who fails the minimum validation process. For instance, providing a wrong zip code would lead to the following result
Headers
Content-type
application/json
Cache-Control
no-cache,private
Body
Bloc de code | ||
---|---|---|
| ||
{
"message": "Provided data contains error(s). See each entry in [errors]",
"errors": {
"address.zipcode": "This value is not valid."
}
} |
message
Always the same error message, indicating that an error happened during the validation process
errors
An associative array where the key represents the logical path to the data in error and the value represents the error found with the given data.
If a key contains “.” character, this means nested array. In the case of an array without keys, the logical number would be taken (ex: communication.secondaryPhones.1 would represent the first entry provided in secondaryPhones)
Response (403) - Forbidden access
Headers
Content-type
application/json
Cache-Control
no-cache,private
Body
language | json |
---|
| |||
Response(400) - Validation ErrorThis scenario happens if you sent any content who fails the minimum validation process. For instance, failing to provide valid apiservice name will lead to the following result | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response (403) - Forbidden accessThis scenario happens if you sent non-existing locationUuid | |||
Content-Type | application/json | ||
Body | |||
|
DELETE {url}/localtrac/location/{locationUuid}/categories/{apiserviceSlug} | |||
---|---|---|---|
This route will delete (clean) all {apiservice_slug} categories, associated with this location. | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response (403) - Forbidden accessThis scenario happens if you sent non-existing locationUuid | |||
Content-Type | application/json | ||
Body | |||
|
GET {url}/localtrac/categories/{apiserviceSlug}/{language}/?s={searchTerm} | |||
---|---|---|---|
This route will search categories for selected apiservice. | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Parameters | |||
apiserviceSlug | Short name of apiservices. For example: gmb, fb, foursquare, bing, yelp…. | ||
language | Primary language of results. Only “en” and “fr” are supported. | ||
searchTerm | The word or just several letters to search. For example “hot”. | ||
Response (200) - Success | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response (404) - Not FoundThis scenario happens if you sent non-existing or not supported apiservice slug | |||
Headers | |||
Content-Type | application/json |