Text messaging has become such an integral part of our daily lives. Flowroute outlines some of the potential use cases for SMS here. This tutorial aims to help you navigate Flowroute's services from account setup to your first SMS.

Steps

Sign up and retrieve your API credentials

Sign up for your Flowroute account here. Make sure to activate your account to receive your API credentials.

Once your account is activated, you can find your API credentials in the Preferences > API Control tab of the Flowroute Manage portal. Your API credentials contain the following information:
Key Value
Access Key This serves as your API username and is equivalent to your Tech Prefix.
Secret Key This serves as your API password and can be reset if necessary.

Purchase a phone number

The Manage portal features a Purchase tab for single numbers which displays a list of available area and exchange codes (NPA NXXs). You can find a step-by-step tutorial for the process here.

Account Help

While most of our phone numbers are ready to go with SMS, there is a chance that we will have to coordinate with one of our partners to enable SMS on yours. If you encounter any issues during the account setup process, please contact Support.

Send your message

In this tutorial, we will show you two methods of creating an HTTP POST request to the Flowroute Messaging API:

Request via cURL

  1. Open a command shell session.
  2. If you haven't installed cURL previously, download your specific source package here.
  3. Copy the following example POST request.
  4. curl https://api.flowroute.com/v2/messages \
    -u accessKey:secretKey -X POST \
    -H "Content-Type: application/json" \
    -d '{"to":"12061231234","from":"12065551234", "body":"hello world"}'
    
                        
  5. Replace accessKey:secretKey with your API credentials.
  6. In the -d (data) option of your cURL request, make the following substitutions:
    • Replace the from value with your Flowroute phone number.
    • Replace the to value with the recipient phone number.
    • Replace the body with your text message.
  7. Press Enter.

Tips

To avoid errors, make sure to:

  • Enter your API credentials correctly.
  • Use vertical quotes in your request. Learn more about Unicode and and ISO 10646 standards here.
  • Use a backslash (\) at the end of lines to break up a long statement into easier-to-read lines if you're in a UNIX environment. If you're using Windows, replace any backslash at the end of lines with the caret (^) character. Here's a great guide for installing and using cURL.

Example Response

{
  "data": {
    "id": "mdr1-e3672cb28a9d422a9671945c9bc4eb9a"
  }
}

            

Request via Postman

Postman is a highly intuitive GUI platform that lets you build API requests very quickly. Download it for free here. Postman also has a very useful tutorial on how to send your HTTP requests.

  1. In the Authorization tab, do the following:
    • Select Basic Auth for the Type.
    • Enter your accessKey in the username field, and your secretKey in the password field.
  2. In the Body tab, enter the key-value pairs as shown below: An example POST request with body parameters in a multipart/form-data and a 200 OK response
    • Replace the from value with your Flowroute phone number.
    • Replace the to value with the recipient phone number (your cell phone number, for instance).
    • Replace the body with your text message.
  3. Flowroute API Response

    On success, the HTTP status code in the response header is 200 OK and the response body contains the message ID. Use the ID above to retrieve details of your first SMS.

    Potential Error Codes

    Return codes in the 400 range typically indicate that there was an issue with the request that was sent. Among other things, this could mean that you did not authenticate correctly, that you are requesting an action that you do not have authorization for, that the object you are requesting does not exist, or that your request is malformed.

    If you receive a status in the 500 range, this generally indicates a server-side problem. This means that we are having an issue on our end and cannot fulfill your request currently. Here is a list of general errors that you can expect from the Flowroute API.

    Please refer to the API reference page for more example errors, an explanation on the accepted request parameters, and other ways to send your first SMS.