Subscribe
webhooks enables you to get updates on changes, without the need to poll the Gett business API.
What's a webhook?
A webhook is an endpoint that you set up on a publicly accessible server you control. After registering that endpoint with Gett, Gett will then make HTTP POST requests to it when certain events occur. The POST body will be sent as JSON, in the following format:
Subscribing to webhooks allows you to track changes in the reports in real-time.
Request
Resource url | https://business-api.gett.com/v1/subscribers?businessId=<companyUUID> | |
businessid | string | Company UUID identificator obtained from Gett in registration process |
event_types | string | from_list "status_changed" "business_report" |
hook_address | string | valid url of endpoint to receive updates. |
curl --request POST \
--url 'https://business-api.gett.com/v1/subscribers?businessId=[company_uuid]' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer [token]' \
--header 'Content-Type: application/json' \
--data '{"hook_address":"https://host/endpoint","event_types":"business_report"}'
Response
Name | Type | Desc. |
---|---|---|
id | string | subscriber id. |
hook_address | string | valid url of endpoint to receive updates. |
event_types | object | list of event types in hook |
event_types[].event_type | string | event type |
business_ids | object | list of business id's |
business_ids[].business_id | string | business id relevant to event |
secret_id | string | uuid verification token used to validate that request was sent from Gett. |
created_at | string | RFC 3339 date. states when subscription has been created. |
updated_at | string | RFC 3339 date. states when subscription has been updated. |
{
"id": "e3982=-b3d798e89fcb",
"hook_address": "https://host/endpoint",
"event_types": [
{
"event_type": "business_report"
}
],
"business_ids": [
{
"business_id": "6AA6CF-gegege-fgfgf-ghghg06"
}
],
"secret_id": "bf53-b973-0fd890f2b39c",
"created_at": "2021-05-09T16:33:48.518547841Z",
"updated_at": "2021-05-09T16:33:48.518547841Z"
}
Updated over 3 years ago
What’s Next