Listing Subscribers And Subscriptions
The Subscriber query returns information about the Subscriber and Subscriptions for the integration. This query can be useful in determining if you have successfully created a Subscriber or Subscriptions.
At this time we only allow one Subscriber per API user
Query
Query
query Subscribers {
subscribers {
id
name
subscriptions {
eventEntity
eventKey
parentEntity
parentId
subscriberId
}
webhookUrl
}
}
Return Type
Returns a [Subscriber!]
Successful Responses
When the subscribers query succeeds you can expect the response payload to look in one of three different ways:
If you have not yet created a Subscriber the
subscribersfield value will empty.If you have created a Subscriber but have not yet created any Subscriptions the
subscriptionsfield value will empty.If you have created
subscriptionsall of them for the Subscriber will be returned.
Response - Without Subscribers
{
"data": {
"subscribers": []
}
}
Response - Without Subscriptions
{
"data": {
"subscribers": [
{
"id": "your-subscriber-id",
"name": "Example Provider Updated - Example Brand",
"subscriptions": [],
"webhookUrl": "https://example.net/subscriptions"
}
]
}
}
Response - With Subscriptions
{
"data": {
"subscribers": [
{
"id": "your-subscriber-id",
"name": "Example Provider Updated - Example Brand",
"subscriptions": [
{
"eventEntity": "Menu",
"eventKey": "updated",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "MenuCreationRequest",
"eventKey": "failed",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "MenuCreationRequest",
"eventKey": "succeeded",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "MenuCreationRequest",
"eventKey": "succeeded_with_warnings",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "Order",
"eventKey": "accepted",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "Order",
"eventKey": "cancelled",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "Order",
"eventKey": "rejected",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "Order",
"eventKey": "submitted",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
},
{
"eventEntity": "Order",
"eventKey": "uncancelled",
"parentEntity": "Caterer",
"parentId": "ezcater-caterer-id",
"subscriberId": "your-subscriber-id"
}
],
"webhookUrl": "https://example.net/subscriptions"
}
]
}
}
Failure Responses
When the subscribers query fails you can expect the response payload to look like:
Response - Without Subscribers
{
"data": {
"subscribers": []
}
}