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.

OpenAPI-Spezifikation herunterladen

Retrieve all Applications

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

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

Abfrage Parameter

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
Standard10

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.

Antworten
Inhalt Typ
application/json

OK

count
integer
Erforderlich
Beispiel1

The number of items associated with your account.

page_size
integer
Erforderlich
Beispiel10

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

page_index
integer
Erforderlich
Beispiel1

The offset from the first page.

_embedded
object
Erforderlich
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
Beispielaaaaaaaa-bbbb-cccc-dddd-0123456789ab

The ID allocated to your application by Nexmo.

name
string
Erforderlich
BeispielMy Application

The name of your application

voice
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielanswer_url
Muss eines der folgenden sein:answer_urlevent_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielGET

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

Muss eines der folgenden sein:GETPOST
messages
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielstatus_url
Muss eines der folgenden sein:inbound_urlstatus_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielPOST

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

Muss eines der folgenden sein:GETPOST
keys
object

The Nexmo product that you access with this application.

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

The link URL.

_links
object
Erforderlich

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

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

The link URL.

Beispiel Antwort

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

Anfrage Körper
Inhalt Typ
application/json

api_key
string
Erforderlich
Beispielap1k3y

You can find your API key in your account overview

api_secret
string
Erforderlich
Beispiel230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Erforderlich
BeispielMy Application

The name of your application.

type
string
Erforderlich
Beispielvoice

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

Muss eines der folgenden sein:voicemessages
answer_url
string
Beispielhttps://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
BeispielGET

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

event_url
string
Beispielhttps://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
BeispielPOST

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

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

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

status_method
string
BeispielPOST

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

inbound_url
string
Beispielhttps://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
BeispielPOST

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

Beispiel Anfrage

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

Antworten
Inhalt Typ
application/json

Created

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

The ID allocated to your application by Nexmo.

name
string
Erforderlich
BeispielMy Application

The name of your application

voice
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielanswer_url
Muss eines der folgenden sein:answer_urlevent_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielGET

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

Muss eines der folgenden sein:GETPOST
messages
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielstatus_url
Muss eines der folgenden sein:inbound_urlstatus_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielPOST

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

Muss eines der folgenden sein:GETPOST
keys
object

The Nexmo product that you access with this application.

public_key
string
BeispielPUBLIC_KEY

The public key used to validate the JWT.

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

The link URL.

Beispiel Antwort

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

Abfrage Parameter

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

Pfad Parameter

app_id
string
Erforderlich

The ID allocated to your application by Nexmo.

Antworten
Inhalt Typ
application/json

OK

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

The ID allocated to your application by Nexmo.

name
string
Erforderlich
BeispielMy Application

The name of your application

voice
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielanswer_url
Muss eines der folgenden sein:answer_urlevent_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielGET

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

Muss eines der folgenden sein:GETPOST
messages
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielstatus_url
Muss eines der folgenden sein:inbound_urlstatus_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielPOST

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

Muss eines der folgenden sein:GETPOST
keys
object

The Nexmo product that you access with this application.

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

The link URL.

Beispiel Antwort

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

Pfad Parameter

app_id
string
Erforderlich

The ID allocated to your application by Nexmo.

Anfrage Körper
Inhalt Typ
application/json

api_key
string
Erforderlich
Beispielap1k3y

You can find your API key in your account overview

api_secret
string
Erforderlich
Beispiel230e6cf0709417176df1b4fc1e083adc

You can find your API secret in your account overview

name
string
Erforderlich
BeispielUpdatedApplication

The name of your application.

type
string
Erforderlich
Beispielvoice

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.

Muss eines der folgenden sein:voicemessages
answer_url
string(url)
Beispielhttps://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
StandardGET
BeispielGET

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

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

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

event_method
string
StandardPOST
BeispielPOST

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

Beispiel Anfrage

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

Antworten
Inhalt Typ
application/json

OK

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

The ID allocated to your application by Nexmo.

name
string
Erforderlich
BeispielMy Application

The name of your application

voice
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielanswer_url
Muss eines der folgenden sein:answer_urlevent_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielGET

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

Muss eines der folgenden sein:GETPOST
messages
object
Erforderlich

The Nexmo product that you access with this application.

webhooks
array
endpoint_type
string
Erforderlich
Beispielstatus_url
Muss eines der folgenden sein:inbound_urlstatus_url
endpoint
string(url)
Erforderlich
Beispielhttps://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
Erforderlich
BeispielPOST

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

Muss eines der folgenden sein:GETPOST
keys
object

The Nexmo product that you access with this application.

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

The link URL.

Beispiel Antwort

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

Pfad Parameter

app_id
string
Erforderlich

The ID allocated to your application by Nexmo.

Antworten

No content