Messaging V2 API Account Setup (UI)

Follow

Jessica Murray

Updated

This article references the ‘New’ interface in the Bandwidth Dashboard. Looking for the ‘Classic’ experience? Click here!

    

Table of Contents

Before We Get Started

Create an Application

Order Phone Numbers

Sending Messages

Related Links

 

Before we get started

  1. Have you downloaded Postman or have the ability to make an API request? 
    1. Postman is an app for easy RESTful API exploration. In this guide, we will use Postman to send messages using our new application.
    2. Screenshot.PNG
    3. Once you’ve downloaded Postman and created an account (if you don’t already have one), open the Postman Collection
    4. In order to send messages with Bandwidth, you’ll need several pieces of information that can be located in the Bandwidth Dashboard:
      • Username and password
        • These are your credentials to log into the Bandwidth Dashboardmceclip7.png
      • Account ID
        1. Once logged into the Dashboard, click on the Account menu
        2. Locate your Account ID at the top of the Account Overview sectionmceclip1.png
      • Sub-Account 
        • If you have an existing Sub-Account, from top Navigation menu (screenshot below) click "Account," then "Sub-accounts".
        • You'll see the ID for the sub-account on the left-hand side of this screen. Enter this ID into the Postman form.mceclip2.png

 

      • Messaging API Token and Secret
        • Bandwidth APIs use BASIC HTTP Authentication. You'll need to have your account ID, token, and secret to make API calls.
        • You may already have a Token and Secret that you can enter into the Postman form, but if you need a new set of credentials, you’ll need to follow the steps below.
        • In the Dashboard, navigate to the Applications menu. In the top right of your screen, you’ll see a link for API credentials.
        • mceclip3.png
        • Click the button to CREATE NEW and then copy the credentials into a safe place for future use. Token and Secret pairs will not be visible after you leave this screen.Screenshot_7.PNG

 

Create an Application

  1. Now that we’ve taken care of the prerequisites, we’re ready to create an Application. Start by clicking the Applications menu in the dashboard.
  2. Create New 
  3. Enter your Application name
  4. Your Application ID is created for you
  5. Enter your Callback URL (this is the URL of your server)
  6. Create Applicationmceclip4.png

Create a Location

Once you’ve created your Application, we’ll need to associate it with a Location. If you have an existing Location, you’ll choose the 'Associate a location with this application' link. If not, you’ll need to click the link to 'Create a location'.

You can read more about the steps for creating your Location as well as descriptions of the fields in the 'Add a Location' provisioning box in our support article.

mceclip5.png

  1. When creating a Location, click 'Account', 'Locations'
  2. Then 'Add Location'.
  3. Select the Sub-account that the Location will be associated with
  4. And enter a name for your Location.
  5. Select the SMS and MMS settings appropriate for your account.
  6. When selecting HTTPV2 Messaging (if your SMS Protocol is HTTP), you'll need to use the drop down to assign the Application we just created to this Location.
  7. After selecting all of the appropriate settings for your Location, click Submit.

 

Order Phone Numbers

  1. Now that we’ve done all the set up work for our application, we need to order a phone number to use to send text messages.
  2. Once your order/purchase has been completed, you'll land on the New Number Order Details page. 
  3. Scroll down the page till you see the number you ordered and use the Copy to Clipboard button to grab the number. This is the number you'll use to send and receive messages with your Application.mceclip6.png

 

Fill in the Postman Collections Environment Variables

1. Now you’ve gathered all the information needed to complete the Postman Collection environment variables. The collection should now appear in Postman when you toggle to the Collections tab. Click the three dots highlighted in the image below. Then you will click the Edit option.

ui5.png

  1. You will see a window pop up as shown in the image below. Navigate to the Variables tab.
    1. Fill in the information under the Current Value fields. Postman will use these variables to fill in the relevant fields of your request. Once the variables are filled in, select Update.
      1. accountId: your account ID
      2. apiToken: your Bandwidth messaging Token
      3. apiSecret: your Bandwidth messaging Secret
      4. messagingApplicationId: your Bandwidth messaging application IDui6.png

Sending Messages

  1. At this point you should have completed the following: 
    1. Downloaded Postman and filled out the Postman Collection form with your individual credentials, and potentially created a Sub-Account and Location in this step.
    2. Created an Application
    3. Ordered number(s)
  2. Let’s head over to Postman and see what it looks like to actually send a message:
    1. Open Postman and toggle over to Collections.
    2. Use the drop down to open the Bandwidth Messaging Collection and click Send Text Messages.send_message.png
  3. Select POST Send Text Message and then click into the Authorization tab.
    1. The Authorization will be pulled from your environment variables as added earlier in the guide.
    2. Your Account ID and messaging Application ID will also be filled from the environment variables.
    3. The value should read as inherit auth from parent
      1. mceclip0.png
  4. Now let’s move over to the Body tab in Postman.
    1. Enter the following information and then click Send:
      1. From: The number we ordered in the previous section of the guide
      2. To: The number you’re sending the message to
      3. Text: Update with the message you want to send
      4. ApplicationID: From your Application in the Dashboard (autofilled from environment variables)   
    2. You should see a Status of 202 Accepted and a message completed to the receiving party.
  5. Message Parameters

Parameter

Mandatory

Description

from

Yes

One of your telephone numbers the message should come from (must be in E.164 format, like +19195551212).

to

Yes

The phone number the message should be sent to (must be in E.164 format, like +19195551212).

text

Yes

The contents of the text message (must be 2048 characters or less).

applicationId

Yes

The ID of the Application your from number is associated with in the Bandwidth Phone Number Dashboard.

 

Related Links

Article is closed for comments.