This article describes the steps for updating a subscription in BlueDolphin.
HTTP response status code | Interpretation |
---|---|
200 OK | Subscription updated successfully |
400 Bad Request | Subscription could not be updated due to invalid tenant and last updated bydata passed |
500 Internal Server Error | The subscriptions couldn’t be updated due to a server error |
Make a PATCH request to /subscriptions/{id}
Request must include:
- The header for your API request
- The {tenant} needs to be replaced with the tenant's name
- The ID needs to be replaced with the ID of the subscription to retrieve
- The request body, which must include at least the following:
NOTE: All properties not specified in the body will be updated with either empty or null values. Thus, all properties should be included in the body for update
Parameter | Required | Type | Description |
---|---|---|---|
url | ✓ | string | The external URL to which messages will be sent for the bluedolphin_event. |
bluedolphin_event | ✓ | string | The event topic for which a listener will be created with the subscription. The events that are supported,
|
last_updated_by | ✓ | string | The ID of the user updating the subscription |
object_definition_id | ✓ | string |
Unique identifier of an object definition. For example, 000000000000000000000002 An empty value is allowed, it returns all object definitions, e.g.,"" = all object definitions |
workspace_id | ✓ | string |
The workspace where the event will take place. For example, 000000000000000000000001. An empty value is allowed, it returns all workspaces, e.g.,"" = all workspaces |
status | optional | boolean | The status of the subscription. By default, subscriptions are created with a status of 0 (disabled). Allowed statuses are,
|
headers | optional | Dictionary<string, string> | Any headers required for authorization against an external URL provided |
http_verb | optional | string | The type of request to be made against the external URL provided. By default, POST requests are made |
Example API Request
curl --location --request PATCH 'https://public-api.eu.bluedolphin.app/v1/subscriptions/{id}’ \
--header 'tenant: tenantName’ \
--header 'Content-Type: application/json' \
--data '{
"last_updated_by": "000000000000000000",
“url": “some external url“,
"bluedolphin_event": "event name",
"object_definition_id": "000000000000000000000001",
"workspace_id": "000000000000000000000001",
"HEADERS": {
"custom_header": "custom_value"
},
"status": 1,
"http_verb": "POST"
}
Successful response
A successful call returns a response with a 200 OK HTTP status code and the following body:
{
"data":
{
"id": "Unique identifier",
"last_updated_by": "Unique identifier",
"url": "Unique URL provided",
"bluedolphin_event": "Event Name",
"object_definition_id": "000000000000000000000001",
"workspace_id": "000000000000000000000001",
"headers": {},
"status": 0,
"http_verb": "POST"
}
}
Response properties
Property | Type | Description |
---|---|---|
id | string | Unique identifier for the subscription |
last_updated_by | string | Unique identifier of the person who last updated the subscription |
url | string | The external url provided to which messages are sent |
bluedolphin_event | string | The event name for which the subscription was created |
object_definition_id | string | Unique identifier of the object definition that the object is based on |
workspace_id | string | Unique identifier of the workspace where the event is located |
Comments
0 comments
Please sign in to leave a comment.