Webhooks¶
Webhooks allow you to get push notifications when resources change, without the need for polling. This API enables CRUD on webhooks.
Webhooks collection¶
GET¶
Retrieve list of webhooks of a specific organization.
GET /orgs/{org_pk}/webhooks/
Example request:
curl -iL --request GET "https:/www.readycloud.com/api/v2/orgs/1/webhooks/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
Response 200 (application/json):
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"url": "/api/v2/orgs/1/webhooks/1/",
"remote_url": "https://example.com/catch-rc-webhook/contacts/",
"token": "a3f7f07de894cd3c2f7f50248ccbd4",
"created_at": "2018-03-30T08:18:48Z",
"updated_at": "2018-03-30T08:18:48Z",
"entity": "contact",
"suspended_at": null
}
]
}
POST¶
Create new webhook for a specific organization.
POST /orgs/{org_pk}/webhooks/
Allowed values for entity
(default to orders
):
- ‘orders’ # for order updates, including contained resources such as boxes and items (available also in v1)
- ‘packaging’ # for packaging updates (available also in v1)
- ‘contact’ # for contact updates, without related/dependent objects
- ‘contact-address’ # for contact address updates, without related contact objects
- ‘acceptance-scan’ # for order carrier acceptance scan event
- ‘webhook’ # for webhooks (calendar) updates, global for all users, without related objects
Allowed values for remote_url
: any HTTPS URL
All other properties are read-only.
Example request:
curl -iL --request POST -H "Content-Type: application/json" --upload-file data.json "https:/www.readycloud.com/api/v2/orgs/1/webhooks/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
data.json:
{
"entity": "contact",
"remote_url": "https://example.com/contacts/v2/"
}
Response 201 (application/json):
{
"url": "/api/v2/orgs/1/webhooks/2/",
"remote_url": "https://example.com/contacts/v2/",
"token": "a3f7f07de894cd3c2f7f50248ccbd4",
"created_at": "2018-03-30T00:00:16.159321Z",
"updated_at": "2018-03-30T00:00:16.159321Z",
"entity": "contact",
"suspended_at": null
}
Webhook¶
GET¶
Retrieve details of a specific webhook.
GET /orgs/{org_pk}/webhooks/{webhook_pk}/
Example request:
curl -iL --request GET "https:/www.readycloud.com/api/v2/orgs/1/webhooks/1/?bearer_token=4ef5b29b1f4f35c383bebfccf4bf4d01"
Response 200 (application/json):
{
"url": "/api/v2/orgs/1/webhooks/1/",
"remote_url": "https://example.com/catch-rc-webhook/contacts/",
"token": "a3f7f07de894cd3c2f7f50248ccbd4",
"created_at": "2018-03-30T08:18:48Z",
"updated_at": "2018-03-30T08:18:48Z",
"entity": "contact",
"suspended_at": null
}
DELETE¶
Delete a specific webhook.
DELETE /orgs/{org_pk}/webhooks/{webhook_pk}/
Response 204 (application/json)