Nexmo Application API

Version 1

This version of the API has been deprecated. Please use version 2 going forwards.

A Nexmo application contains the security and configuration information you need to connect to Nexmo endpoints and easily use our products.

Télécharger la spécification OpenAPI

Retrieve all Applications

You use a GET request to retrieve details of all applications associated with your account.

gethttps://api.nexmo.com/v1/applications/

Demande de renseignements Paramètres

api_key
string

You can find your API key in your account overview

api_secret
string

You can find your API secret in your account overview

page_size
integer
Défaut10

Set the number of items returned on each call to this endpoint. The default is 10 records.

page_index
integer

Set the offset from the first page. The default value is 0.

Réponses
Type de contenu
application/json

OK

count
integer
Exigée
exemple1

The number of items associated with your account.

page_size
integer
Exigée
exemple10

The number of items returned on each call to this endpoint. The default is 10 records.

page_index
integer
Exigée
exemple1

The offset from the first page.

_embedded
object
Exigée
applications
array

The collection of your applications. Each object contains information about an an individual application. The public_key is not included in the application information.

id
string
exempleaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Exigée
exempleMy Application

The name of your application

voice
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exempleanswer_url
Il doit s'agir de l'un d'entre eux :answer_urlevent_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/answer

answer_url: The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url. event_url: Nexmo sends event information asynchronously to this URL when status changes.

http_method
string
Exigée
exempleGET

The HTTP method used to send event information to the event_url or answer_url.

Il doit s'agir de l'un d'entre eux :GETPOST
messages
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exemplestatus_url
Il doit s'agir de l'un d'entre eux :inbound_urlstatus_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/status

inbound_url: The URL where inbound messages are delivered. status_url: The URL where message status is delivered.

http_method
string
Exigée
exemplePOST

The HTTP method used to send data to the inbound_url or status_url. Default is POST.

Il doit s'agir de l'un d'entre eux :GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
exemplePUBLIC_KEY

The public key used to validate the JWT.

_links
object

A series of links between resources in this API in the following HAL specification.

href
string(url)
exemple/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

_links
object
Exigée

A series of links between resources in this API in the following HAL specification.

href
string(url)
exemple/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Exemple Réponse

{
   "count": 1,
   "page_size": 10,
   "page_index": 1,
   "_embedded": {
      "applications": [
         {
            "id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
            "name": "My Application",
            "voice": {
               "webhooks": [
                  {
                     "endpoint_type": "answer_url",
                     "endpoint": "https://example.com/webhooks/answer",
                     "http_method": "GET"
                  }
               ]
            },
            "messages": {
               "webhooks": [
                  {
                     "endpoint_type": "status_url",
                     "endpoint": "https://example.com/webhooks/status",
                     "http_method": "POST"
                  }
               ]
            },
            "keys": {
               "public_key": "PUBLIC_KEY"
            },
            "_links": {
               "href": "/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
            }
         }
      ]
   },
   "_links": {
      "href": "/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
   }
}

Create Application

You use a POST request to create a new application.

posthttps://api.nexmo.com/v1/applications/

Corps de la demande
Type de contenu
application/json

api_key
string
Exigée
exempleap1k3y

You can find your API key in your account overview

api_secret
string
Exigée
exemple230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Exigée
exempleMy Application

The name of your application.

type
string
Exigée
exemplevoice

The Nexmo product or products that you access with this application. Currently voice and messages application types are supported.

Il doit s'agir de l'un d'entre eux :voicemessages
answer_url
string
exemplehttps://example.com/webhooks/answer

The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url. Required for inbound calls only.

answer_method
string
exempleGET

The HTTP method used to make the request to answer_url. The default value is GET.

event_url
string
exemplehttps://example.com/webhooks/event

Nexmo sends event information asynchronously to this URL when status changes for voice applications. Always required for voice applications.

event_method
string
exemplePOST

The HTTP method used to send event information to event_url. The default value is POST. For voice type applications only.

status_url
string
exemplehttps://example.com/webhooks/status

Nexmo sends event information asynchronously to this URL when status changes. Required for messages type applications only.

status_method
string
exemplePOST

The HTTP method used to send event information to status_url. The default value is POST. For messages type applications only.

inbound_url
string
exemplehttps://example.com/webhooks/inbound

Nexmo sends a request to this URL when an inbound message is received. Required for messages type applications only.

inbound_method
string
exemplePOST

The HTTP method used to send event information to inbound_url. The default value is POST. For messages type applications only.

Exemple Demande

{
   "api_key": "ap1k3y",
   "api_secret": "230e6cf0709417176df1b4fc1e083adc",
   "name": "My Application",
   "type": "voice",
   "answer_url": "https://example.com/webhooks/answer",
   "answer_method": "GET",
   "event_url": "https://example.com/webhooks/event",
   "event_method": "POST",
   "status_url": "https://example.com/webhooks/status",
   "status_method": "POST",
   "inbound_url": "https://example.com/webhooks/inbound",
   "inbound_method": "POST"
}

Réponses
Type de contenu
application/json

Created

id
string
exempleaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Exigée
exempleMy Application

The name of your application

voice
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exempleanswer_url
Il doit s'agir de l'un d'entre eux :answer_urlevent_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/answer

answer_url: The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url. event_url: Nexmo sends event information asynchronously to this URL when status changes.

http_method
string
Exigée
exempleGET

The HTTP method used to send event information to the event_url or answer_url.

Il doit s'agir de l'un d'entre eux :GETPOST
messages
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exemplestatus_url
Il doit s'agir de l'un d'entre eux :inbound_urlstatus_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/status

inbound_url: The URL where inbound messages are delivered. status_url: The URL where message status is delivered.

http_method
string
Exigée
exemplePOST

The HTTP method used to send data to the inbound_url or status_url. Default is POST.

Il doit s'agir de l'un d'entre eux :GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
exemplePUBLIC_KEY

The public key used to validate the JWT.

private_key
string
exemplePRIVATE_KEY

The private key you use to generate the JSON Web Token (JWT) that authenticates your requests to Messages API.

_links
object

A series of links between resources in this API in the following HAL specification.

href
string(url)
exemple/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Exemple Réponse

{
   "id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "name": "My Application",
   "voice": {
      "webhooks": [
         {
            "endpoint_type": "answer_url",
            "endpoint": "https://example.com/webhooks/answer",
            "http_method": "GET"
         }
      ]
   },
   "messages": {
      "webhooks": [
         {
            "endpoint_type": "status_url",
            "endpoint": "https://example.com/webhooks/status",
            "http_method": "POST"
         }
      ]
   },
   "keys": {
      "public_key": "PUBLIC_KEY",
      "private_key": "PRIVATE_KEY"
   },
   "_links": {
      "href": "/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
   }
}

Retrieve Application

You use a GET request to retrieve details about a single application.

gethttps://api.nexmo.com/v1/applications/:app_id

Demande de renseignements Paramètres

api_key
string

You can find your API key in your account overview

api_secret
string

You can find your API secret in your account overview

Trajectoire Paramètres

app_id
string
Exigée

The ID allocated to your application by Nexmo.

Réponses
Type de contenu
application/json

OK

id
string
exempleaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Exigée
exempleMy Application

The name of your application

voice
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exempleanswer_url
Il doit s'agir de l'un d'entre eux :answer_urlevent_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/answer

answer_url: The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url. event_url: Nexmo sends event information asynchronously to this URL when status changes.

http_method
string
Exigée
exempleGET

The HTTP method used to send event information to the event_url or answer_url.

Il doit s'agir de l'un d'entre eux :GETPOST
messages
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exemplestatus_url
Il doit s'agir de l'un d'entre eux :inbound_urlstatus_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/status

inbound_url: The URL where inbound messages are delivered. status_url: The URL where message status is delivered.

http_method
string
Exigée
exemplePOST

The HTTP method used to send data to the inbound_url or status_url. Default is POST.

Il doit s'agir de l'un d'entre eux :GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
exemplePUBLIC_KEY

The public key used to validate the JWT.

_links
object

A series of links between resources in this API in the following HAL specification.

href
string(url)
exemple/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Exemple Réponse

{
   "id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "name": "My Application",
   "voice": {
      "webhooks": [
         {
            "endpoint_type": "answer_url",
            "endpoint": "https://example.com/webhooks/answer",
            "http_method": "GET"
         }
      ]
   },
   "messages": {
      "webhooks": [
         {
            "endpoint_type": "status_url",
            "endpoint": "https://example.com/webhooks/status",
            "http_method": "POST"
         }
      ]
   },
   "keys": {
      "public_key": "PUBLIC_KEY"
   },
   "_links": {
      "href": "/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
   }
}

Update Application

You use a PUT request to update an existing application.

puthttps://api.nexmo.com/v1/applications/:app_id

Trajectoire Paramètres

app_id
string
Exigée

The ID allocated to your application by Nexmo.

Corps de la demande
Type de contenu
application/json

api_key
string
Exigée
exempleap1k3y

You can find your API key in your account overview

api_secret
string
Exigée
exemple230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Exigée
exempleUpdatedApplication

The name of your application.

type
string
Exigée
exemplevoice

The Nexmo product or products that you access with this application. Currently voice and messages application types are supported. You can't change the type of application.

Il doit s'agir de l'un d'entre eux :voicemessages
answer_url
string(url)
exemplehttps://example.com/webhooks/answer

The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url.

answer_method
string
DéfautGET
exempleGET

The HTTP method used to make the request to answer_url. The default value is GET.

event_url
string(url)
exemplehttps://example.com/webhooks/event

Nexmo sends event information asynchronously to this URL when status changes.

event_method
string
DéfautPOST
exemplePOST

The HTTP method used to send event information to event_url. The default value is POST.

Exemple Demande

{
   "api_key": "ap1k3y",
   "api_secret": "230e6cf0709417176df1b4fc1e083adc",
   "name": "UpdatedApplication",
   "type": "voice",
   "answer_url": "https://example.com/webhooks/answer",
   "answer_method": "GET",
   "event_url": "https://example.com/webhooks/event",
   "event_method": "POST"
}

Réponses
Type de contenu
application/json

OK

id
string
exempleaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Exigée
exempleMy Application

The name of your application

voice
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exempleanswer_url
Il doit s'agir de l'un d'entre eux :answer_urlevent_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/answer

answer_url: The URL where your webhook delivers the Nexmo Call Control Object that governs this call. As soon as your user answers a call Nexmo makes a request to answer_url. event_url: Nexmo sends event information asynchronously to this URL when status changes.

http_method
string
Exigée
exempleGET

The HTTP method used to send event information to the event_url or answer_url.

Il doit s'agir de l'un d'entre eux :GETPOST
messages
object
Exigée

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Exigée
exemplestatus_url
Il doit s'agir de l'un d'entre eux :inbound_urlstatus_url
endpoint
string(url)
Exigée
exemplehttps://example.com/webhooks/status

inbound_url: The URL where inbound messages are delivered. status_url: The URL where message status is delivered.

http_method
string
Exigée
exemplePOST

The HTTP method used to send data to the inbound_url or status_url. Default is POST.

Il doit s'agir de l'un d'entre eux :GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
exemplePUBLIC_KEY

The public key used to validate the JWT.

_links
object

A series of links between resources in this API in the following HAL specification.

href
string(url)
exemple/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Exemple Réponse

{
   "id": "aaaaaaaa-bbbb-cccc-dddd-0123456789ab",
   "name": "My Application",
   "voice": {
      "webhooks": [
         {
            "endpoint_type": "answer_url",
            "endpoint": "https://example.com/webhooks/answer",
            "http_method": "GET"
         }
      ]
   },
   "messages": {
      "webhooks": [
         {
            "endpoint_type": "status_url",
            "endpoint": "https://example.com/webhooks/status",
            "http_method": "POST"
         }
      ]
   },
   "keys": {
      "public_key": "PUBLIC_KEY"
   },
   "_links": {
      "href": "/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab"
   }
}

Destroy Application

You use a DELETE request to delete a single application.

deletehttps://api.nexmo.com/v1/applications/:app_id

Trajectoire Paramètres

app_id
string
Exigée

The ID allocated to your application by Nexmo.

Réponses

No content