Nexmo Application API

Versión 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.

Descargar la especificación 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/

Consulta Parámetros

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
Por defecto10

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.

Respuestas
Tipo de contenido
application/json

OK

count
integer
Requerido
ejemplo1

The number of items associated with your account.

page_size
integer
Requerido
ejemplo10

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

page_index
integer
Requerido
ejemplo1

The offset from the first page.

_embedded
object
Requerido
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
ejemploaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Requerido
ejemploMy Application

The name of your application

voice
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemploanswer_url
Debe ser uno de:answer_urlevent_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploGET

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

Debe ser uno de:GETPOST
messages
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemplostatus_url
Debe ser uno de:inbound_urlstatus_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploPOST

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

Debe ser uno de:GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
ejemploPUBLIC_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)
ejemplo/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

_links
object
Requerido

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

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

The link URL.

Ejemplo Respuesta

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

Cuerpo de la solicitud
Tipo de contenido
application/json

api_key
string
Requerido
ejemploap1k3y

You can find your API key in your account overview

api_secret
string
Requerido
ejemplo230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Requerido
ejemploMy Application

The name of your application.

type
string
Requerido
ejemplovoice

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

Debe ser uno de:voicemessages
answer_url
string
ejemplohttps://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
ejemploGET

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

event_url
string
ejemplohttps://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
ejemploPOST

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

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

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

status_method
string
ejemploPOST

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

inbound_url
string
ejemplohttps://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
ejemploPOST

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

Ejemplo Solicitar

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

Respuestas
Tipo de contenido
application/json

Created

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

The ID allocated to your application by Nexmo.

name
string
Requerido
ejemploMy Application

The name of your application

voice
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemploanswer_url
Debe ser uno de:answer_urlevent_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploGET

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

Debe ser uno de:GETPOST
messages
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemplostatus_url
Debe ser uno de:inbound_urlstatus_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploPOST

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

Debe ser uno de:GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
ejemploPUBLIC_KEY

The public key used to validate the JWT.

private_key
string
ejemploPRIVATE_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)
ejemplo/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Ejemplo Respuesta

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

Consulta Parámetros

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

Ruta Parámetros

app_id
string
Requerido

The ID allocated to your application by Nexmo.

Respuestas
Tipo de contenido
application/json

OK

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

The ID allocated to your application by Nexmo.

name
string
Requerido
ejemploMy Application

The name of your application

voice
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemploanswer_url
Debe ser uno de:answer_urlevent_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploGET

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

Debe ser uno de:GETPOST
messages
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemplostatus_url
Debe ser uno de:inbound_urlstatus_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploPOST

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

Debe ser uno de:GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
ejemploPUBLIC_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)
ejemplo/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Ejemplo Respuesta

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

Ruta Parámetros

app_id
string
Requerido

The ID allocated to your application by Nexmo.

Cuerpo de la solicitud
Tipo de contenido
application/json

api_key
string
Requerido
ejemploap1k3y

You can find your API key in your account overview

api_secret
string
Requerido
ejemplo230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Requerido
ejemploUpdatedApplication

The name of your application.

type
string
Requerido
ejemplovoice

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.

Debe ser uno de:voicemessages
answer_url
string(url)
ejemplohttps://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
Por defectoGET
ejemploGET

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

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

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

event_method
string
Por defectoPOST
ejemploPOST

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

Ejemplo Solicitar

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

Respuestas
Tipo de contenido
application/json

OK

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

The ID allocated to your application by Nexmo.

name
string
Requerido
ejemploMy Application

The name of your application

voice
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemploanswer_url
Debe ser uno de:answer_urlevent_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploGET

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

Debe ser uno de:GETPOST
messages
object
Requerido

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Requerido
ejemplostatus_url
Debe ser uno de:inbound_urlstatus_url
endpoint
string(url)
Requerido
ejemplohttps://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
Requerido
ejemploPOST

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

Debe ser uno de:GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
ejemploPUBLIC_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)
ejemplo/v1/applications/aaaaaaaa-bbbb-cccc-dddd-0123456789ab

The link URL.

Ejemplo Respuesta

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

Ruta Parámetros

app_id
string
Requerido

The ID allocated to your application by Nexmo.

Respuestas

No content