Update a Callback
Use this endpoint to update an existing callback. You must specify the callback name, URL, and authentication details in the request body. Using this endpoint, you can update an existing callback’s URL or batch size.
A successful response returns the updated details for the callback.
Service URL:
/rest/api/v1.3/notifications/callbacks/{callbackName}
Path Parameters:
callbackName
– Name of the callback to update.
Request Method:
PUT
Request Header:
Authorization=<AUTH_TOKEN>
Content-Type=application/json
Request Body - Required Properties:
name
– Name of the callback to update.
authentication
– Authentication credentials to connect to the callback URL. Basic authentication (B) using a username and password is the only authentication method currently supported.
One of:
url
– New URL location for the callback.
batchSize
– New callback batch size.
Request Body - Optional Properties:
-
backupUrl
– A back up callback URL for Responsys to call, in the event theurl
is unreachable. After 3 unsuccessful attempts at theurl
, Responsys will call the back up URL. The back up URL can be on the same domain as the primary URL, but cannot be the exact location.
Sample Request Body
{
"url": "<callback_url>",
"backupUrl ": "<backupCallbackUrl>",
"batchSize": <batch_size>,
"authentication": {
"type": "B",
"data": {
"userName": "<username>",
"password": "<password>"
}
}
}
Sample Response Body - Success
{
"name": "<callback_name>",
"url": "<callback_url>",
"backupUrl ": "<backupCallbackUrl>",
"batchSize": 1,
"links": [
{
"rel": "self",
"href": "<callback_url>",
"method": "PUT"
},
{
"rel": "getCallBack",
"href": "<callback_url>",
"method": "GET"
},
{
"rel": "deleteCallBack",
"href": "<callback_url>",
"method": "DELETE"
}
]
}
Sample Response Body - Failure
404 Not Found
Callback not found: Requests fail if the callback name specified is not found. The error resembles:
{
"type": "",
"title": "Object not found",
"errorCode": "OBJECT_NOT_FOUND",
"detail": "CallBack [<callback_name>] not found",
"errorDetails": []
}
400 Bad Request
URL already exists: Requests fail if a callback with the URL specified already exists. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "Callback url <callback_url> ] already exists",
"errorDetails": []
}
Invalid credentials: Requests fail if the credentials specified in the request cannot be used to connect to the URL specified. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "Could not connect to callback url [<callback_url>]",
"errorDetails": []
}
Invalid authentication: Requests fail if the authentication method specified is invalid. Only Basic Authentication (B) is supported. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "Only Basic Authentication is supported currently and value should be 'B' ",
"errorDetails": []
}
Empty batch size: Requests fail if the batch size specified is less than 0. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "Batch Size cannot be less than 0",
"errorDetails": []
}
Empty callback name: Requests fail if a callback name is not specified. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "callback name cannot be empty or null",
"errorDetails": []
}
Empty URL: Requests fail if a callback URL is not specified. The error resembles:
{
"type": "",
"title": "Invalid request parameters",
"errorCode": "INVALID_PARAMETER",
"detail": "callback url cannot be empty or null",
"errorDetails": []
}
Empty authentication: Requests fail if an authentication type is not specified. The error resembles:
{
"type": "",
"title": "Invalid field name",
"errorCode": "INVALID_FIELD_NAME",
"detail": "The following field names [invalid_field_names_list] are invalid",
"errorDetails": []
}