Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.

...

Avertissement

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)

Bloc de code
{
	"businessUuid":"{businessUuid}",
	"webhookUrl":"https://google.com.ua",
	"webhookSalt": "very_secure_string_to_be_md5_encoded"
}

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

Bloc de code
{
  "success": true
}

Response(400) - Validation Error

This 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

Bloc de code
{
  "message": "Provided data contains error(s). See each entry in [errors]",
  "errors": {
    "businessUuid": "This field is missing."
  }
}

Response (403) - Forbidden access

This scenario happens if you sent non-existing businessUuid (or Store Localtor is not enabled for this business).

Content-Type

application/json

Body

Bloc de code
{
  "message": "You do not have the required permission to alter this resource: business({businessUuid})"
}

...