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 messages role privilege.

NameTypeDescriptionRequiredDefault value
auth_usernameStringAuthentication username.Yes
auth_passwordStringAuthentication password.Yes
cnumberStringThe destination to send the message to.Yes
messageStringThe message to send.Yes
stypeString"phone" to send from a telephone line, empty string to send from a number.RecommendedEmpty string.
snumberStringThe telephone line or number to send from.Yes
customerIntegerID of customer to send as.NoCustomer of authentication user.

The customer must own the sending number or telephone line.

Responses

CodeDescription
204Message successfully submitted for sending.
400Invalid input parameters specified. Check the key and message fields for more details.
401The authentication details provided are invalid.
402Your role does not allow this.
403Your rate plan does not allow this.

Data returned

No data is returned.

Example: Sending from a number

http://enswitch.example.com/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

http://enswitch.example.com/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" } ] }

Change history

VersionChanges
3.13Function added.