Setting disposition code for the call

The POST v0/{accountKey}/calls/{callGuid}/dispositionCode endpoint allows you to set the disposition code for the call. Specify the disposition code for the call in the query string parameter, callGuid.

In this page


Most URLs in the example code use the following values:

  • ***. To access the API for your region, replace *** with the correct subdomain for your region:
  • a1b2c3d4e5. The value represents the Vonage Contact Center account on which the API request is run. To run the API request on your account data, you must replace a1b2c3d4e5, where used, with your account's API key. For example, if your API key is mtovfiliti3, use mtovfiliti3 in place of a1b2c3d4e5.
  • <ACCESS_TOKEN>. The value represents a bearer access token which you must use to validate every request. Replace <ACCESS_TOKEN> where used with your bearer access token. For information about getting a bearer access token, see Getting a bearer access token.

Header Parameters

This endpoint requires the following headers:

Authorization (required)

This header requires an OAuth bearer token. For information on the bearer token, see How to use your bearer access token.

Content-Type(required)

application/json

Indicates that the media type sent by the client is JavaScript Object Notation (JSON).

Request Examples

Set 'Wrong Number' disposition code for call 94e5928c-7f7e-4645-ad72-61010f906449 for agent 1234

curl -X POST "https://***.newvoicemedia.com/v0/a1b2c3d4e5/calls/94e5928c-7f7e-4645-ad72-61010f906449/dispositionCode" 
-d '{ "dispositionCode": "Wrong Number", "agentId": "1234" }' 
-H "Authorization: Bearer <ACCESS_TOKEN>" 
-H "Content-Type: application/json"

Body

{
  "dispositionCode": "Wrong Number",
  "agentId": "1234"
}

dispositionCode has a minimum length of 3 characters and a maximum of 64.

Response Examples

Successful calls return HTTP status code of 201, containing the following message and headers.

Example: Successful response

Returns HTTP Status Code 200 OK.

{
  "dispositionCode": "Wrong Number"
}


Example: Invalid request data

Returns HTTP Status Code 400.

  • Invalid blank dispositionCode
{
  "message": "Disposition code field was expected. "
}

  • Invalid dispositionCode: max length of disposition code value is 255 characters
{
 "message": "Disposition code excceeds 255 characters."
}

Example: Unknown call specified

Returns HTTP Status Code 404.

{
 "message": "The requested resource was not found."
}