SMS Routing
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 toHTTP-POST
routes, this type of route allows for users to receive inbound SMS messages at an HTTP endpoint of their choosing.
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": "[email protected]",
"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": "[email protected]",
"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.
GET https://sms.accentvoice.com/api/v2/<DID Number>/routes?key=<API Key>
None
Remember: For API
GET
requests, your API Key must be provided as a URL parameter!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": "[email protected]",
"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.
GET https://sms.accentvoice.com/api/v2/<DID Number>/routes/<Route ID>/?key=<API Key>
None
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:
DELETE https://sms.accentvoice.com/api/v2/<DID Number>/routes/44/
Parameter | Description | Required |
ID | The ID of the route to delete | Yes |
curl "https://sms.accentvoice.com/api/v2/<DID Number>/routes/"
-X POST
{
"key": "<API Key>",
"type": "EMAIL",
"payload": "[email protected]"
}
This request creates a new
{
"error": false,
"success": true,
"route": {
"did_id": 1,
"type": "EMAIL",
"payload": "[email protected]",
"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 newHTTP-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 newHTTP-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.
POST https://sms.accentvoice.com/api/v2/<DID Number>/routes/
Parameter | Description | Required |
type | EMAIL , HTTP-POST , or HTTP-GET | Yes |
payload | Route-specific payload | Yes |
Last modified 3yr ago