Update a Subscription

Use this interface to update an existing subscription. You might want to use this endpoint to update the event types for an existing subscription.

A successful response returns details about the updated subscription.

Service URL:

/rest/api/v1.3/notifications/subscriptions/{subscriptionName}

Path Parameters:

subscriptionName – Name of the subscription to update.

Request Method:

GET

Request Header:

Authorization=<AUTH_TOKEN>

Content-Type=application/json

Request Body - Required Properties:

callBackName – Required. Unique name of the callback.

eventTypes – Required. Array of events to update the subscription. Comma-separated list of event types.

status – Optional. Indicates the status of the callback subscription. Possible values include: ACTIVE or PAUSED.

statusReason – Optional. Describes a reason for changing the status.

filters - Optional. This is an array of filters that ensures a specific event is only triggered for certain campaigns. Contains an array of eventTypes and an array, values, of criteria to matched. As on 20D, the only supported criteria is a campaignNames array.

Sample Request Body

{
  "callBackName": "<callback_name>",
  "eventTypes": ["EMAIL_BOUNCED"],
  "status": "PAUSED"
}

Sample Response Body - Success

{
  "subscriptionName": "<subscription_name>",
  "callBackUrl": "<callback_url>",
  "callBackName": "<callback_name>",
  "batchSize": 100,
  "eventTypes": [
    "EMAIL_BOUNCED"
  ],
  "status": "PAUSED"
  "filters": [
    {
      "eventTypes": [
        "EMAIL_FAILED"
      ],
      "values": [
        {
          "campaignNames": [
            "vk_campaign_failed"
          ]
        }
      ]
    }
  ]
}

Sample Response Body - Failure

404 Not Found

Invalid subscription: Requests fail if the specified subscription cannot be found. The error resembles:

{
  "type": "",
  "title": "Object not found",
  "errorCode": "OBJECT_NOT_FOUND",
  "detail": "Subscription with name [<subscription_name> ] not found",
  "errorDetails": []
}

Callback not found: Requests fail if the callback cannot be found. The error resembles:

{
  "type": "",
  "title": "Object not found",
  "errorCode": "OBJECT_NOT_FOUND",
  "detail": "Subscription [<subscription_name> ] does not exists",
  "errorDetails": []
}

Event not supported or invalid: Requests fail if any events specified are not found or are not supported. The error resembles:

{
  "type": "",
  "title": "Object not found",
  "errorCode": "OBJECT_NOT_FOUND",
  "detail": "Event Type [ SMS_FAILED1 ] not found or is not supported",
  "errorDetails": []
}

No events specified: Requests fail if no events are specified in the request. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Event type is empty or null",
  "errorDetails": []
}

Status is not specified: Requests fail if no subscription status is specified in the request. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Subscription status cannot be empty or null",
  "errorDetails": []
}

Invalid status: Requests fail if the subscription status specified in the request is invalid. Subscription status must either be ACTIVE or PAUSED. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Subscription status can only be ACTIVE or PAUSED",
  "errorDetails": []
}

Duplicate events: Requests fail if duplicate event types are specified in the request. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "Duplicate event types found in the request",
  "errorDetails": []
}

Event already subscribed: Requests fail if any specified events are already being used in other active subscriptions. The error resembles:

{
  "type": "",
  "title": "Invalid request parameters",
  "errorCode": "INVALID_PARAMETER",
  "detail": "There's an active subscription for event [ SMS_MO_FW_FAILED ] with other subscriptions",
  "errorDetails": []
}

Learn more

Retrieve a List of Supported Events

Event Responses