Use this endpoint to update the ability to send and receive SMS and MMS messages for a specific phone number.
Numbers in inventory at Flowroute are not SMS/MMS provisioned by default.
Please see Flowroute Pricing for the costs associated with enabling a number to send and receive messages.
Endpoint
POST /v2/message-provisionRequest Parameters
Path Parameters
-
numbers
array of strings requiredAn array of numbers as strings to take action on.
-
action
string requiredThe action to take: "enable" or "disable"
-
callback_url
stringThe callback URL to be called when the Message Provision Task status is updated.
-
email
booleanIf the email address boolean is true in a Message Provision request then an email will be sent on Message Task status updates.
Response Format
On success, the HTTP status code in the response header is 201 Created.If the request included one number, then a message_provisioning_status will be returned.
If the request included more than one number, then a message_bulk_provisioning_status will be returned.
On error, the header status code is an error code and the response body contains an error object.
message_provisioning_status
Response format when one number is included in Message Provision request.
-
data
Object composed of attributes, type, and id.
-
attributes
Object composed of the following:
status - The status of the Message Provision task.
tn - The phone number (tn) in the Message Provision task.
-
type
stringObject type. This will always be message_provisioning_status.
-
id
stringID for the Messaging Provision task.
message_bulk_provisioning_status
Response format when multiple numbers are included in the Message Provision request.
-
data
Object composed of attributes, type, and id.
-
attributes
Object composed of the following:
status - The status of the Message Provision task.
message - Informational messages about the Message Provision task.
numbers - An Object with the numbers separated by status. On submission, all numbers should be in the "processing" status.
successful - An array of numbers that have been successfully provisioned.
processing - An array of numbers that are still processing.
failed - An array of numbers that have failed provisioning.
-
type
stringObject type. This will always be message_provisioning_status.
-
id
stringID for the Messaging Provision task.
Example Request
POST /v2/message-provision HTTP/1.1
Content-Type: application/json
Accept: application/json
{
"data": {
"attributes": {
"numbers": ["12062092844", "12062092845"],
"action": "enable",
"callback_url": "my-callback.com",
"email": "true"
}
}
}
Example Request
curl -u accessKey:secretKey -X POST \
https://api.flowroute.com/v2/message-provision/ \
-d '{ "data": { "attributes": { "numbers": ["12062092844"], "action": "enable", \
"callback_url": "my-callback.com", "email": "true" } } }'
Example Responses
201 Created
{
"data": {
"attributes": {
"status": "processing",
"tn": "12062092844"
},
"type": "message_provisioning_status",
"id": "5fc2952d-97a0-43c3-acf1-d1ecc4452fc2"
}
}
201 Created
{
"data": {
"attributes": {
"status": "processing",
"numbers": {
"processing": [
"12062092844",
"12062092845"
]
}
},
"type": "message_bulk_provisioning_status",
"id": "41bc4443b34d4c8c98af5405c50b687e"
}
}