Push API Setup
Subscription verification process
The following diagram shows an overview of the subscription verification process.
Set up the Push API
Create a valid URL endpoint.
- This has to be implemented on your side.
- This endpoint will receive all the pushed data from our Push Service.
- Make sure your endpoint is publicly accessible.
- The URL may contain a placeholder
{org}
anywhere in it which will be replaced with the proper Organization ID upon pushing - For testing purposes you can set up a temporary endpoint with request.bin, or beeceptor.com
Create a subscription
- Create a subscription using the subscription endpoint.
POST https://api.crowdmanager.io/v2/{organization-id}/pushservice/subscriptions Authorization: Basic {yourApiKey} Content-Type: application/vnd.api+json Accept: application/vnd.api+json { "subscriptions": { "event": "CustomerProfile", "url": "http://your.domain.com/endpointforcrowdmanager?org={org}" } }
- If response of your enpoint will return us a successfull status code (200), - you will get an Id for your new subscription in the response.
{ "subscriptions":{ "id":"56", "href":"https://api.crowdmanager.io/v2/{organization-id}/pushservice/subscriptions/{subscription-id}/", "type":"subscriptions", "url":"http://your.domain.com/endpointforcrowdmanager", "isEnabled":false, "isValidated":false, "event":"CustomerProfile" } }
- Create a subscription using the subscription endpoint.
Validate your subscription
- After you created a subscription, we will invoke a GET request to your specified endpoint:
http://your.domain.com/endpointforcrowdmanager?org={organization-id}&Id={subscriptionid}&ValidationToken={yourvalidationtoken}
- After you created a subscription, we will invoke a GET request to your specified endpoint:
Validate your subscription.
- Now use this validation token to validate your subscription.
PUT https://api.crowdmanager.io/v2/{organization-id}/pushservice/subscriptions/{subscription-id} Authorization: Basic {yourApiKey} Content-Type: application/vnd.api+json Accept: application/vnd.api+json { subscriptions: { "validationToken": "{yourvalidationtoken}" } }
- Now use this validation token to validate your subscription.
Enable your subscription.
Now use this validation token to enable your subscription.
PUT https://api.crowdmanager.io/v2/{organization-id}/pushservice/subscriptions/{subscription-id} Authorization: Basic {yourApiKey} Content-Type: application/vnd.api+json Accept: application/vnd.api+json { subscriptions: { "isEnabled":true } }
Now the subscription is active, any updates on Customer Profiles will be pushed to your endpoint.
You can always temporarly disable a subscription by setting the "isEnabled" to false.
For more Information see: