POST/send/sms

Function


The Post/send/sms method allows you to use your Telebroad account to send an SMS message to a recipient with a mobile phone or another Telebroad account that supports SMS messaging.


Parameters


There are no parameters in the header. All parameters go in the body in JSON Raw format.


Basic parameters


ParameterTypeOperation
sms_linestringThe user's SMS line that will be used for sending the message.
receiver
stringThe number of the intended recipient of the message.
msgdataintegerThe actual content of the SMS message.


Additional MMS parameters

Use these additional parameters to send a file attachment as a multimedia message. 


The main parameter to add multimedia functionality to the message is "media". It is a JSON array that contains all the other relevant parameters for the message.

ParameterTypeOperation
mediaarrayA JSON array containing the other relevant multimedia parameters. 
mimetype
stringThe type and format of media sent with the message. For example a JPEG image or a WAV audio file.

The syntax is - image/png,  audio/wav, video/mp4, application/pdf etc.

Although this is also included in the base64 information for image files, without this parameter the preview of the message on the recipient side may not display properly.
namestringThe name of the file attached to the MMS message.
iconstringIndicates that the MMS message will be sent with an icon to identify the attached file.

Possible values:

image - the icon will look like the attached image file itself. Use this for image attachments.

insert_drive_file - the icon will be a general "download file icon" -> . Use this for any other file attachments other than images.

This is optional, but without it the message preview on the recipient side may not display properly.
sizestringYou can indicate the size of the attached file in Bytes, KB, or MB.

Optional, but let's the receiver know how big the file is before he downloads it.
Value

or

compressed
stringThe data for the MMS message encoded into a text string using the base64 format.

Use compressed for image attachments. This also includes the type and format of the media (same as "mimetype") with this syntax - data:image/png;base64,

Use value for all other file types. You don't need to include the base64 syntax here.

Converting a file to base64 can be easily done with one of many online converters, such as this one. After performing the conversion simply copy and paste the resulting string into the data field. Note that the resulting string may be many pages long, especially for a PDF file.

Example


Basic SMS


To send the SMS messages "Hello world" from SMS line 1-646-702-4430 to 1-323-444-7299 use this syntax:


HTTPS method: POST


Header

webserv.telebroad.com/api/teleconsole/rest/send/sms


Body

{"sms_line":"16467024430","receiver":"13234447299,"msgdata":"Hello world"}


Response:


If the message was sent successfully:


{

"error": null,

"result": true

}


If there was a problem sending the message:


{

"error":{

"code": 444,

"message": "Failed to send message"

}



MMS Message


To send the a picture and a messages saying "My vacation" from SMS line 1-646-702-4430 to 1-323-444-7299 use this syntax:


HTTPS method: POST


Header

webserv.telebroad.com/api/teleconsole/rest/send/sms


Body


The data field may be many pages long. Shown here is a truncated version.


{

    sms_line":"16466991371","receiver":"19178644345",

    "msgdata":"My vacation",

    "media":"[{\"mimetype\":\"image/png\",\"name\":\"Rome.png\",

    \"size\":\"23.7KB\",\"icon\":\"image\",

    \"compressed\":\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJo

        AAACECAIAAADnQaWrAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAAD

        sMAAA7DAcdvqGQAAAL2SURBVHhe7dxBbtswEEDRtFfqBbrtibvNBXomlwANIbBk2Y7JmdHX/

        5sYWWn4RNqIY/+4XC4fRunn9achkhOVnKjkRCUnKjlRyYlKTlRyopITlZyo5EQlJyo5UcmJSk5Uc

        qKSE5WcqOREJScqOVHJiUpOVHKikhOVnKjkRCUnKjlRyYlKTlRyopITlZyo5EQlJyo5UcmJSk5UcqKS

        E5WcqOREJScqOVHJiQr4fba///y7Pnqvz7+/ro+OE4FzlN8zFTc+AGek1ksVpC3KWZZwszqutTiP

        pbgu3bUE51jFIWv67UvKFU3mHAIZtoJPXm2iaCZn/dXZb+

.

.

.

                 /42yo5EQlJyo5QX18/AcGTkL6B28BJwAAAABJRU5ErkJggg==\

"}]"}  


Response:


If the message was sent successfully:


{

"error": null,

"result": true

}


If there was a problem sending the message:


{

"error":{

"code": 444,

"message": "Failed to send message


Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.