SMS Routing

Routes

Routes are the functions that are executed each time that an inbound SMS message is received by an Accent DID. Currently, there are three (3) types of routes:

  • EMAIL Routes: These routes will send inbound SMS messages to an e-mail address, which also allows for users to respond to the SMS message with a simple reply to the e-mail.

  • HTTP-POST Routes: This route is also known as an "incoming webhook" and allows for users to receive inbound SMS messages at an HTTP endpoint of their choosing.

  • HTTP-GET Routes: Similar to HTTP-POST routes, this type of route allows for users to receive inbound SMS messages at an HTTP endpoint of their choosing.

Get All Routes

Retrieve all routes for a given DID.

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes?key=<API Key>"

This request returns a JSON payload of this structure:

[
    {
        "id": 34,
        "did_id": 1,
        "type": "EMAIL",
        "payload": "david@xyz.com",
        "priority": 2,
        "active": 1,
        "updated_at": "2019-03-18 14:38:04",
        "created_at": "2019-03-18 14:38:04"
    },
    {
        "id": "44",
        "did_id": 1,
        "type": "EMAIL",
        "payload": "david@abc.com",
        "priority": 1,
        "active": 1,
        "updated_at": "2019-03-12 12:16:44",
        "created_at": "2019-03-12 12:16:44"
    }
]

This endpoint retrieves all routes for a given DID.

HTTP Request

GET https://sms.accentvoice.com/api/v2/<DID Number>/routes?key=<API Key>

Query Parameters

None

Remember: For API GET requests, your API Key must be provided as a URL parameter!

Get a Specific Route

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/?key=<API Key>"

This request returns a JSON payload of this structure:

{
    "id": "44",
    "did_id": 1,
    "type": "EMAIL",
    "payload": "david@xyz.com",
    "priority": 1,
    "active": 1,
    "updated_at": "2019-03-12 12:16:44",
    "created_at": "2019-03-12 12:16:44"
}

This endpoint retrieves a specific route for a given DID.

HTTP Request

GET https://sms.accentvoice.com/api/v2/<DID Number>/routes/<Route ID>/?key=<API Key>

URL Parameters

None

Delete a Specific Route

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/"
  -X DELETE

This request returns a JSON payload of this structure:


{
   "error": false,
   "success": true,´
   "message": "Route with ID 44 was successfully deleted."
 }

This request deletes a route, and has this response:

HTTP Request

DELETE https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/

URL Parameters

Parameter

Description

Required

ID

The ID of the route to delete

Yes

Create a New Route

EMAIL Route

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
  -X POST
{
    "key": "<API Key>",
    "type": "EMAIL",
    "payload": "your-email@address.us"
}

This request creates a new EMAIL route, and has this response:

{
  "error": false,
  "success": true,
  "route": {
      "did_id": 1,
      "type": "EMAIL",
      "payload": "david@xyz.com",
      "priority": 64,
      "active": 1,
      "updated_at": "2019-03-18 14:38:04",
      "created_at": "2019-03-18 14:38:04",
      "id": 34
  }
}

HTTP-POST Route

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
  -X POST
{
    "key": "<API Key>",
    "type": "HTTP-POST",
    "payload": {
        "url": "https://test-website.braves.com/endpoint",
        "headers": { // Headers are always optional.
            "header1": "value1",
            "header2": "value2"
        }
    }
}

This request creates a new HTTP-POST route, and has this response:

{
  "error": false,
  "success": true,
  "route": {
      "did_id": 1,
      "type": "HTTP-POST",
      "payload": {
          "url": "https://test-website.braves.com/endpoint",
          "headers": { // Headers are always optional.
              "header1": "value1",
              "header2": "value2"
          }
      },
      "priority": 64,
      "active": 1,
      "updated_at": "2019-03-18 14:38:04",
      "created_at": "2019-03-18 14:38:04",
      "id": 34
  }
}

HTTP-GET Route

curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
  -X POST
{
    "key": "<API Key>",
    "type": "HTTP-GET",
    "payload": {
        "url": "https://test-website.braves.com/endpoint",
        "headers": { // Headers are always optional.
            "header1": "value1",
            "header2": "value2"
        }
    }
}

This request creates a new HTTP-GET route, and has this response:

{
  "error": false,
  "success": true,
  "route": {
      "did_id": 1,
      "type": "HTTP-GET",
      "payload": {
          "url": "https://test-website.braves.com/endpoint",
          "headers": { // Headers are always optional.
              "header1": "value1",
              "header2": "value2"
          }
      },
      "priority": 64,
      "active": 1,
      "updated_at": "2019-03-18 14:38:04",
      "created_at": "2019-03-18 14:38:04",
      "id": 34
  }
}

This endpoint creates a new route for a DID. You must choose a route type before creating a route.

HTTP Request

POST https://sms.accentvoice.com/api/v2/<DID Number>/routes/

Request Body Parameters

Parameter

Description

Required

type

EMAIL, HTTP-POST, or HTTP-GET

Yes

payload

Route-specific payload

Yes

Last updated