The resource subscription is based in REST Hooks.
Name | Type | Description |
---|---|---|
object | string | Is "resource_subscription". |
event | string | |
target_url | string | |
api_version | string | |
created | integer |
{
"object": "resource_subscription",
"event": "customer.created",
"target_url": "http://example.com/resource_subscription_example",
"api_version": "04-09-2014",
"created":1412036808
}
A resource subscription can be created over the API.
Name | Required/Optional | Description |
---|---|---|
event | required | The event to trigger for. |
target_url | required | The target URL to send webhooks to. |
$ curl https://spaces.com/api/v1/resource_subscriptions \
-u ACCESS_TOKEN: \
-d event="customer.created" \
-d target_url="http://example.com/resource_subscription_example"
Will respond with 200 OK
status, and the full resource subscription object if valid, or fail with failure HTTP status code.
Returns a list of all resource subscriptions.
curl https://spaces.com/api/v1/resource_subscriptions \
-u ACCESS_TOKEN:
{
"object": "list",
"count": 20,
"has_more": true,
"data": [
{
"object": "resource_subscription",
"event": "customer.created",
"target_url": "http://example.com/resource_subscription_example",
"api_version": "04-09-2014",
"created":1412036808
},
{...}
]
}