Skip to main content

Update a Subscription

Jetmir Abdija avatar
Written by Jetmir Abdija
Updated this week

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 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 the update

Parameter

Required

Type

Description

url

Optional

string

The external URL to which messages will be sent for the bluedolphin_event.

object_definition_id

Optional

string

Unique identifier of an object definition.

For example, 000000000000000000000002

workspace_id

Optional

string

The workspace where the event will take place.

For example, 000000000000000000000001.

bluedolphin_event

Optional

string

The event topic for which a listener will be created for with the subscription.

status

optional

boolean

The status of the subscription. By default, subscriptions are created with a status of 0 (disabled). Allowed statuses are,

  • Disabled = 0

  • Enabled = 1

headers

Optional

Dictionary<string, string>

Any headers required for authorization against the external URL provided

http_verb

optional

string

The type of request to be made against the external URL provided.

Allowed values are GET, POST, and PATCH

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 '{
“url": “some external url“,
"bluedolphin_event": "event name",
"object_definition_id": "000000000000000000000001",
"workspace_id": "000000000000000000000001",
"HEADERS": {
"custom_header": "custom_value"
},
"status": 1
}

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 user who last updated the subscription

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

status

boolean

running state (1 = running)

url

string

The external URL to which messages are sent

headers

Dictionary<string, string>

Any headers required for authorization against the URL provided

http_verb

string

The type of request to be made against the URL provided.
POST and PATCH are allowed.

Did this answer your question?