Update Subscription Parameters
Updates the parameters associated with an existing subscription. The updated parameter values will be sent as HTTP request headers in subsequent invocations of the callback URL.
Endpoint
PUT /api/subscriptions/{subscriptionId}
Headers
Name | Required | Description |
---|---|---|
Authorization | required | If Basic Authentication is being used, then header value must be of the form Basic <encoded_data>, where <encoded_data> is the Base64 encoding of the username and the password joined by a colon. If JWT authentication is being used, then header value must be of the form Bearer , where is the JWT obtained via the get authentication token method described earlier. |
Content-Type | required | application/x-www-form-urlencoded |
<header name> | optional | An optional header name/value pair to be associated with the subscription. Any number of additional optional headers may be specified. These headers will be echoed back as request headers when invoking the callback URL. Any headers to be interpreted in this way must be specified in the cogito.subscriptions-webhook.subscribeHeaderParams section of the DAS config. |
Path Parameters
Name | Required | Type | Description |
---|---|---|---|
subscriptionId | required | integer | The unique subscription ID received in the response to a subscription request |
Body Parameters
Name | Required | Type | Description |
---|---|---|---|
<parameter name> | required | string | A parameter name and updated value to be associated with the subscription. At least one parameter to update must be specified, but more than one parameter may be specified. The updated parameter values will be sent as HTTP request headers in subsequent invocations of the callback URL. |
Request Example
Example 1- Basic Authentication
curl --request PUT 'https://notifications.cogito.us/api/subscriptions/123' \
--header 'Authorization: Basic dGVzdDp0ZXN0' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'UserData: myData' \
--data-urlencode 'token=JIUzUxMiJ9.eyJzdWIiOiJwZXJmVGV2'
Example 2- JWT Authentication
curl --request PUT 'https://notifications.cogito.us/api/subscriptions/123' \
--header 'Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJwZXJmVGVzdEFnZW50XzIwIiwiZXhwaXJ' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'UserData: myData' \
--data-urlencode 'token=JIUzUxMiJ9.eyJzdWIiOiJwZXJmVGV2'
Response Example
A successful response will return HTTP Status 200 OK
with no response body. If no subscription matching the given subscriptionId exists, or no parameter matching the given parameter name exists on the subscription, then a 404 Not Found
error will be returned.
Updated about 2 years ago