Traffic Control API

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.

OpenAPI-Spezifikation herunterladen

Retrieve the current queue size

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

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Pfad Parameter

product_name
string
Erforderlich

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

Muss eines der folgenden sein:sms

Antworten
Inhalt Typ
application/json

OK.

_embedded
object
Erforderlich
data
object
queue_size
integer
Beispiel100
_links
object
Erforderlich
self
object
Erforderlich
href
string(URL)
Erforderlich
Beispiel/v0.1/vtc/queues/product/sms/current
templated
boolean
Erforderlich

Beispiel Antwort

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

Authentifizierung

SchlüsselBeschreibungWoBeispiel
Authorization

Base64-kodierter API-Schlüssel und Geheimnis, verbunden durch einen Doppelpunkt.
Mehr lesen

Headers

Basic <base64>

Pfad Parameter

product_name
string
Erforderlich

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

Muss eines der folgenden sein:sms

Abfrage Parameter

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.

Antworten
Inhalt Typ
application/json

OK.

_embedded
object
Erforderlich
historical_data
array
queue_size
integer
Beispiel30
timestamp
string(date-time)
Beispiel2024-06-12T15:59:22.870Z
_links
object
Erforderlich
self
object
Erforderlich
href
string(URL)
Erforderlich
Beispiel/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
Erforderlich

Beispiel Antwort

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

Fehler

Im Folgenden finden Sie eine nicht erschöpfende Liste von Fehlercodes, die bei der Verwendung dieser API auftreten können.

Diese Codes gelten zusätzlich zu unseren generische Fehlercodes.

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