How to List Notification Subscriptions

In the context of events (both polling and webhooks), element instances can be setup with an event notification callback URL that serves as the final destination for your events processed through Cloud Elements. When an element instance is setup with an event notification callback URL and events are enabled, a notification subscription is created and, as events are notified within Cloud Elements, a notification is also sent to the defined callback URL.

To retrieve a list of all subscriptions in an account execute this request:

curl -X GET \
  https://api.cloud-elements.com/elements/api-v2/notifications/subscriptions \
  -H 'Authorization: User XXXXX, Organization XXXXX' \
  -H 'accept: application/json' 

Within the response of this API call are the subscriptions that exist in an account based on the 'topics' within a subscription. For example, if there is a Salesforce element instance 523232 with an event notification callback URL defined, then the 'topics' within the subscription will be: "instance-523232-sfdc-events". This endpoint is useful to review which element instances are setup with a specific callback url.

 {
 "id": 6569100,
 "channel": "webhook",
 "topics": [
 "instance-523232-sfdc-events"
 ],
 "config": {
 "url": "https://yourEventNotificationCallback"
 },
 "active": true
 }

These subscriptions can be retrieved and deleted by ID if necessary for review and maintenance of notification subscriptions. If an event notification callback URL needs to be modified, this should be done in the instance configuration itself so that a new subscription is created, but in rare cases when a subscription needs to be manually deleted this endpoint can be used. 

curl -X GET \
  https://api.cloud-elements.com/elements/api-v2/notifications/subscriptions/{id} \
  -H 'Authorization: User XXXXX, Organization XXXXX' \
  -H 'accept: application/json'