Create a Vonage Messages and Dispatch Application

In this topic you learn how to create a Vonage API application.

Create a Vonage API Application

There are three alternative methods for creating a Messages application:

  1. Using the Vonage CLI
  2. Using the Dashboard
  3. Using the Application API

Each of these methods is described in the following sections.

How to Create a Messages Application Using the Vonage CLI

To create your application using the Vonage CLI, enter the following command into the shell:

vonage apps:create "My Messages App" --messages_inbound_url=https://example.com/webhooks/inbound-message --messages_status_url=https://example.com/webhooks/message-status

This command creates a Vonage API application with a messages capability, and the webhook URLs are configured as specified. It also generates a private key file my_messages_app.key and creates or updates the vonage_app.json file.

Store the generated private key securely when the command completes. JWT authentication for the Messages API depends on this key, and if you lose it you cannot re-download the original private key.

How to Create a Messages Application Using the Dashboard

You can create a Messages application in the Dashboard.

To create your application using the Dashboard:

  1. Under Applications in the Dashboard, click the Create a new application button.

  2. Under Name, enter the Application name. Choose a name for ease of future reference.

  3. Click the button Generate public and private key. This will create a public/private key pair and the private key will be downloaded by your browser.

    Store the downloaded private key securely. JWT authentication for the Messages API depends on this key, and if you lose it you cannot re-download the original private key.

  4. Under Capabilities select the Messages button.

  5. In the Inbound URL box, enter the URL for your inbound message webhook, for example, https://example.com/webhooks/inbound-message.

  6. In the Status URL box, enter the URL for your message status webhook, for example, https://example.com/webhooks/message-status.

  7. Click the Generate new application button. You are now taken to the next step of the Create Application procedure where you can link a Vonage API number to the application, and link external accounts such as Facebook to this application.

  8. If there is an external account you want to link this application to, click the Linked external accounts tab, and then click the corresponding Link button for the account you want to link to.

You have now created your application.

NOTE: Before testing your application ensure that your webhooks are configured and your webhook server is running.

How to Create a Messages Application Using the Application API

The Application API lets you create and configure a Vonage Application programmatically — without using the dashboard or the CLI. A Vonage Application created via the Application API works the same as one created through the dashboard.

For a full overview of how to create a Vonage Application, see Create a Vonage Application.