JSON API » messages » messages/text/send
Sends a text message. The actual sending up is asynchronous, and will happen after the function returns.
Input parameters
Requires authentication and the send_message role privilege.
Name | Type | Description | Required | Default value |
---|---|---|---|---|
auth_username | String | Authentication username. | Yes | |
auth_password | String | Authentication password. | Yes | |
cnumber | String | The destination to send the message to. | Yes | |
message | String | The message to send. | Yes | |
stype | String | "phone" to send from a telephone line, empty string to send from a number. | Recommended | Empty string. |
snumber | String | The telephone line or number to send from. | Yes | |
customer | Integer | ID of customer to send as. | No | Customer of authentication user. |
The customer must own the sending number or telephone line.
Responses
Code | Description |
---|---|
204 | Message sucessfully submitted for sending. |
400 | Invalid input parameters specified. Check the key and message fields for more details. |
401 | The authentication details provided are invalid. |
402 | Your role does not allow this. |
403 | Your rate plan does not allow this. |
Data returned
No data is returned.
Example: Sending from a number
https://www.015pbx.net/local/api/json/messages/text/send/?auth_username=user;auth_password=password;stype=;snumber=2125550000;cnumber=2125551234;message=This%20is%20an%example%20message{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }
Example: Sending from a telephone line
https://www.015pbx.net/local/api/json/messages/text/send/?auth_username=user;auth_password=password;stype=phone;snumber=1234567;cnumber=2125551234;message=This%20is%20an%example%20message{ "responses":[ { "code":"204", "key":"", "message":"OK" } ] }