Traffic Control API

Versión 0.1

The Traffic Control API is a RESTful API that provides access to real-time and historical queue size data for the Vonage Traffic Control service. The API allows you to retrieve the current queue size for a specific product, as well as historical queue size data for a specific product over a specified date range.

Descargar la especificación OpenAPI

Retrieve the current queue size

gethttps://api.nexmo.com/v0.1/vtc/queues/product/:product_name/current

Autenticación

ClaveDescripciónDóndeEjemplo
Authorization

Clave API codificada en Base64 y secreto unidos por dos puntos.
Seguir leyendo

Headers

Basic <base64>

Ruta Parámetros

product_name
string
Requerido

The name of the product to retrieve the queue size for. Must be sms.

Debe ser uno de:sms

Respuestas
Tipo de contenido
application/json

OK.

_embedded
object
Requerido
data
object
queue_size
integer
ejemplo100
_links
object
Requerido
self
object
Requerido
href
string(URL)
Requerido
ejemplo/v0.1/vtc/queues/product/sms/current
templated
boolean
Requerido

Ejemplo Respuesta

{
   "_embedded": {
      "data": {
         "queue_size": 100
      }
   },
   "_links": {
      "self": {
         "href": "/v0.1/vtc/queues/product/sms/current",
         "templated": false
      }
   }
}

Retrieve historical queue size data

gethttps://api.nexmo.com/v0.1/vtc/queues/product/:product_name/historical

Autenticación

ClaveDescripciónDóndeEjemplo
Authorization

Clave API codificada en Base64 y secreto unidos por dos puntos.
Seguir leyendo

Headers

Basic <base64>

Ruta Parámetros

product_name
string
Requerido

The name of the product to retrieve the queue size for. Must be sms.

Debe ser uno de:sms

Consulta Parámetros

start_date
string

The date at which the returned dataset should start in ISO8601 format.

end_date
string

The date at which the returned dataset should end in ISO8601 format.

Respuestas
Tipo de contenido
application/json

OK.

_embedded
object
Requerido
historical_data
array
queue_size
integer
ejemplo30
timestamp
string(date-time)
ejemplo2024-06-12T15:59:22.870Z
_links
object
Requerido
self
object
Requerido
href
string(URL)
Requerido
ejemplo/v0.1/vtc/queues/product/sms/historical?start_date=2024-06-12T15:59:22.870Z&end_date=2024-06-12T15:59:42.870Z
templated
boolean
Requerido

Ejemplo Respuesta

{
   "_embedded": {
      "historical_data": [
         {
            "queue_size": 30,
            "timestamp": "2024-06-12T15:59:22.870Z"
         }
      ]
   },
   "_links": {
      "self": {
         "href": "/v0.1/vtc/queues/product/sms/historical?start_date=2024-06-12T15:59:22.870Z&end_date=2024-06-12T15:59:42.870Z",
         "templated": false
      }
   }
}

Errores

La siguiente es una lista no exhaustiva de códigos de error que pueden producirse al utilizar esta API.

Estos códigos se suman a cualquiera de nuestros códigos de error genéricos.

CódigoInformación
throttled

Your request rate exceeds the allowed limit for this account.

internal-error

An internal error occurred. Please try again later.

invalid-product

Path parameter product_name didn't validate. The given product is not supported.

invalid-provisioner-command

The path segment denoting the action to be performed is not valid. The only allowed actions are /activate and /deactivate.

invalid-date-format

Invalid date format. Please provide the start_date and end_date in ISO8601 format.

missing-query-param

One or more required query parameters was not specified.