POST/send/sms

The Post/send/sms request allows you to use your Telebroad account to send an SMS message to a recipient with a mobile phone, another Telebroad account, or a VoIP line 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.

You can get this from the GET/myProfile request.
receiver
stringThe number of the intended recipient of the message.
msgdatastringThe 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.
iconstring(optional) Indicates 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.

If the parameter is not included in the request, message preview on the recipient side may not display properly but he can still retrieve the content itself.
sizestring(optional) You can indicate the size of the attached file in Bytes, KB, or MB.

It is helpful to le 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.

Examples


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 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":13234447299 ,

    "msgdata":"My vacation",

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

    \"size\":\"23.7KB\",\"icon\":\"image\",\"value\":\"data:image/png;base64,

iVBORw0KGgoAAAA

NSUhEUgAAAJoAAACECAIAAADnQaWrAAAAAXNSR0IArs4c6QAAAARnQU1B

AACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAL2SURBVHhe7dxBb

tswEEDRtFfqBbrtibvNBXomlwANIbBk2Y7JmdHX/5sYWWn4RNqIY/+4XC

4fRunn9achkhOVnKjkRCUnKjlRyYlKTlRyopITlZyo5EQlJyo5UcmJSk5

UcqKSE5WcqOREJScqOVHJiUpOVHKikhOVnKjkRCUnKjlRyYlKTlRyopIT

lZyo5EQlJyo5UcmJSk5UcqKSE5WcqOREJScqOVHJiQr4fba///y7Pnqvz

7+/ro+OE4FzlN8zFTc+AGek1ksVpC3KWZZwszqutTiPpbgu3bUE51jFIW

67UvKFU3mHAIZtoJPXm2iaCZn/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.