BETA VERSION
Info |
---|
Disclaimer! Some of the routes here will require special (additional) permissions. If you get “Access denied” response, or empty responses - contact your representative! |
Sommaire |
---|
POST {url}/localtrac/store-locator/registerWebhook | |||
---|---|---|---|
This route register the webhook URL of client’s site. Each time, location has some update (except update via api by user with ROLE_STORE_LOCATOR), LOCALTRAC will send POST request to provided URL, sending “secret” parameter equals md5(“webhookSalt”). LOCALTRAC doesn’t send changed fields or the list of changed locations. It’s just a signal that some location(s) was updated. You may use GET “store-locator/locations” route and compare “lastUpdated” to know what location was updated. | |||
Request | |||
Headers | |||
Authorization | <token> obtained during the Authentication | ||
Accept | application/json | ||
Body (Example) | |||
| |||
businessUuid | Uuid of the business to register webhook. Store locator should be enabled for this business. | ||
webhookUrl | URL on clients server/website to be called when location is updated. | ||
webhookSalt | Random string that would be md5 encoded and passed with POST as “secret” parameter. | ||
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 businessUuid will lead to the following result | |||
Headers | |||
Content-Type | application/json | ||
Body | |||
| |||
Response (403) - Forbidden accessThis scenario happens if you sent non-existing businessUuid (or Store Localtor is not enabled for this business). | |||
Content-Type | application/json | ||
Body | |||
|
...