How do I create a Messaging API application?
FollowIf you're a Messaging user, you can find everything you need to start sending text messages on the Applications page in the Bandwidth App:
- Messaging URI: The endpoint for all your Messaging APIs to send and receive messages. This path includes your company’s unique user ID. It's the value that follows the users/ resource.
- API Credentials: Bandwidth APIs use BASIC HTTP Authentication. You'll need your Account ID and API User Credentials to make API calls.
- Developer Docs: Get dialed in with code samples, set-up guides, and more. Visit our API documentation to create applications and send messages.
To create a messaging API application:
- Log in to the Bandwidth App.
- In the side navigation bar, click Applications and select Applications.
- Under Application name, enter a name for your Application.
- Leave the Application ID field blank – we create this for you.
- Under Application type, select Messaging.
As you create your Application, you must decide whether to have a single or multiple callback URLs. Check out the steps for each option below.
Single callback
If you’d like your inbound and status events to be delivered to the same endpoint, complete the following steps:
- Leave the checkbox for Use multiple callback URLs blank.
- Enter your Callback URL. Bandwidth will make an HTTP request to this URL whenever a messaging event takes place.
- Select Use a username/password for callbacks (optional).
- Select your status callback types.
Multiple callbacks
If you’d like to move your status callback events to separate endpoints (one for inbound messages and one for outbound messages), complete the following steps:
Note: If you choose to set up multiple callback URLs, you'll be presented with two additional fields: Inbound Callback URL and Status Callback URL. If you don't set up a Status Callback URL, you won’t receive any callback events for outbound messages.
- Check the Use multiple callback URLs checkbox.
- Set your Inbound Callback URL (required) and Status Callback URL (optional). Bandwidth will make an HTTP request to your Inbound Callback URL whenever a message-received event takes place, and an HTTP request to your Status Callback URL whenever one of the selected status callback types occurs.
- Select Use a username/password for callbacks (optional) for either or both callback URLs.
- Select your status callback types.
Status callback types
You can select which callback events you receive via HTTP request from the options listed on the page. All three of these callback types will be selected as default. To learn more about them, check out the links below.
- Send message-delivered callback
- Send message-failed callback
- Send message-sending callback
To finish updating your callbacks:
- Click Create Application in the bottom right corner.
- Connect the Application to a Location. To do that, you can either create a new Location or associate an existing Location with your Application.
- Copy your Application ID. This is required to send outbound messages. You may also secure your callbacks with basic authentication.
Note: Associating your Application with a Location allows it to send the appropriate callback to the specified Callback URL whenever a phone number receives a messaging event.
Questions? Please open a ticket with your Bandwidth Support Team or hit us up at (855) 864-7776!
Article is closed for comments.