Traffic Control API

Version 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.

Télécharger la spécification OpenAPI

Retrieve the current queue size

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

Authentification

CléDescriptionExemple
Authorization

Clé et secret de l'API encodés en Base64 et reliés par deux points.
En savoir plus

Headers

Basic <base64>

Trajectoire Paramètres

product_name
string
Exigée

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

Il doit s'agir de l'un d'entre eux :sms

Réponses
Type de contenu
application/json

OK.

_embedded
object
Exigée
data
object
queue_size
integer
exemple100
_links
object
Exigée
self
object
Exigée
href
string(URL)
Exigée
exemple/v0.1/vtc/queues/product/sms/current
templated
boolean
Exigée

Exemple Réponse

{
   "_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

Authentification

CléDescriptionExemple
Authorization

Clé et secret de l'API encodés en Base64 et reliés par deux points.
En savoir plus

Headers

Basic <base64>

Trajectoire Paramètres

product_name
string
Exigée

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

Il doit s'agir de l'un d'entre eux :sms

Demande de renseignements Paramètres

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.

Réponses
Type de contenu
application/json

OK.

_embedded
object
Exigée
historical_data
array
queue_size
integer
exemple30
timestamp
string(date-time)
exemple2024-06-12T15:59:22.870Z
_links
object
Exigée
self
object
Exigée
href
string(URL)
Exigée
exemple/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
Exigée

Exemple Réponse

{
   "_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
      }
   }
}

Erreurs

Voici une liste non exhaustive des codes d'erreur susceptibles de se produire lors de l'utilisation de cette API.

Ces codes s'ajoutent à ceux de notre site codes d'erreur génériques.

CodeInformations
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.