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.
1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes?key=<API Key>"
Copied!
This request returns a JSON payload of this structure:
1
[
2
{
3
"id": 34,
4
"did_id": 1,
5
"type": "EMAIL",
6
"payload": "[email protected]",
7
"priority": 2,
8
"active": 1,
9
"updated_at": "2019-03-18 14:38:04",
10
"created_at": "2019-03-18 14:38:04"
11
},
12
{
13
"id": "44",
14
"did_id": 1,
15
"type": "EMAIL",
16
"payload": "[email protected]",
17
"priority": 1,
18
"active": 1,
19
"updated_at": "2019-03-12 12:16:44",
20
"created_at": "2019-03-12 12:16:44"
21
}
22
]
Copied!
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

1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/?key=<API Key>"
Copied!
This request returns a JSON payload of this structure:
1
{
2
"id": "44",
3
"did_id": 1,
4
"type": "EMAIL",
5
"payload": "[email protected]",
6
"priority": 1,
7
"active": 1,
8
"updated_at": "2019-03-12 12:16:44",
9
"created_at": "2019-03-12 12:16:44"
10
}
Copied!
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

1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/"
2
-X DELETE
Copied!
This request returns a JSON payload of this structure:
1
2
{
3
"error": false,
4
"success": true,´
5
"message": "Route with ID 44 was successfully deleted."
6
}
7
Copied!
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
1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
2
-X POST
3
{
4
"key": "<API Key>",
5
"type": "EMAIL",
6
"payload": "[email protected]"
7
}
Copied!
This request creates a new EMAIL route, and has this response:
1
{
2
"error": false,
3
"success": true,
4
"route": {
5
"did_id": 1,
6
"type": "EMAIL",
7
"payload": "[email protected]",
8
"priority": 64,
9
"active": 1,
10
"updated_at": "2019-03-18 14:38:04",
11
"created_at": "2019-03-18 14:38:04",
12
"id": 34
13
}
14
}
Copied!
HTTP-POST Route
1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
2
-X POST
3
{
4
"key": "<API Key>",
5
"type": "HTTP-POST",
6
"payload": {
7
"url": "https://test-website.braves.com/endpoint",
8
"headers": { // Headers are always optional.
9
"header1": "value1",
10
"header2": "value2"
11
}
12
}
13
}
Copied!
This request creates a new HTTP-POST route, and has this response:
1
{
2
"error": false,
3
"success": true,
4
"route": {
5
"did_id": 1,
6
"type": "HTTP-POST",
7
"payload": {
8
"url": "https://test-website.braves.com/endpoint",
9
"headers": { // Headers are always optional.
10
"header1": "value1",
11
"header2": "value2"
12
}
13
},
14
"priority": 64,
15
"active": 1,
16
"updated_at": "2019-03-18 14:38:04",
17
"created_at": "2019-03-18 14:38:04",
18
"id": 34
19
}
20
}
Copied!
HTTP-GET Route
1
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
2
-X POST
3
{
4
"key": "<API Key>",
5
"type": "HTTP-GET",
6
"payload": {
7
"url": "https://test-website.braves.com/endpoint",
8
"headers": { // Headers are always optional.
9
"header1": "value1",
10
"header2": "value2"
11
}
12
}
13
}
Copied!
This request creates a new HTTP-GET route, and has this response:
1
{
2
"error": false,
3
"success": true,
4
"route": {
5
"did_id": 1,
6
"type": "HTTP-GET",
7
"payload": {
8
"url": "https://test-website.braves.com/endpoint",
9
"headers": { // Headers are always optional.
10
"header1": "value1",
11
"header2": "value2"
12
}
13
},
14
"priority": 64,
15
"active": 1,
16
"updated_at": "2019-03-18 14:38:04",
17
"created_at": "2019-03-18 14:38:04",
18
"id": 34
19
}
20
}
Copied!
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 modified 2yr ago