HTTPS API v2 / Sending MMS messages

Principles of operation

To send an MMS message, you must first load the multimedia file using the option of uploading files. Only after uploading the necessary files (eg pictures, sound or video), it is possible to send an MMS message where the subscriber specifies the identifier of the file to be sent.

Uploading a file

Saving the file on the server consists in sending the URL of the file along with the appropriate parameters. The system will check if the file exists and if it meets the requirements and if the verification is successful, the data will be saved on the server and the subscriber will receive a JSON / XML document containing the file identifier. The file is sent in the following way:

files/add

Available parameters

Parameter Type An example value or format Description
username String login Username used to dispatch the message
password String password

Password to the account

type String mms or voice Type file.
url String eg.: http://www.serwer.pl/kat/plik.jpg URL file.
file String file Upload the file from the disk. The "url" must remain empty. Only for MMS files.

 

As a result, a JSON document will be generated, e.g. as follows:

{
   "success": true,
   "id": "b67d70c22d"
}

It is possible to upload certain file types:

Content-Type file extension
application/vnd.ms-excel xls xlm xla xlc xlt xlw
application/msword doc dot
application/vnd.ms-powerpoint ppt pps pot
application/rtf rtf
application/x-tar tgz tar
application/zip zip
application/pdf pdf
application/smil+xml smi smil
application/ogg ogg
application/vnd.ms-cab-compressed cab
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.chart-template otc
application/vnd.oasis.opendocument.chart odc
audio/midi mid midi kar rmi
audio/mpeg mpga mp2 mp2a mp3 m2a m3a
audio/mpeg3 mp3
audio/mp3 mp3
audio/x-mpegurl m3u
audio/wav wav
audio/x-ms-wma wma
audio/x-aiff aif aiff aifc
audio/x-pn-realaudio ram ra
image/pjpeg pjpeg
image/gif gif
image/jpeg jpeg jpg jpe
image/jpg jpeg jpg jpe
image/png png
image/svg+xml svg svgz
image/vnd.djvu djvu djv
image/vnd.wap.wbmp wbmp wbmp
image/x-icon ico
text/plain txt text conf def list log in
text/richtext rtx
text/csv csv
text/x-java-source java
text/x-vcard vcf
text/x-vcalendar vcs
video/3gpp 3gp
video/3gpp2 3g2
video/quicktime qt mov
video/x-ms-asf asf asx
video/avi avi
video/x-msvideo avi
video/x-sgi-movie movie
video/mp4 mp4 mp4v mpg4
video/mpeg mpeg mpg mpe m1v m2v

Listing files

To list files downloaded to the server and retrieve their identifiers, which can then be used in MMS sending, call the action:

files/index

As a result, a JSON document will be generated, e.g. as follows:

{
   "items":[{
      "id":"b67d70c22d",
      "name":"plik1.jpg",
      "size":174562,
      "type":"mms",
      "date":"2014-10-07 16:54:53"
   },
   {
      "id":"39b0d42508",
      "name":"plik2.jpg",
      "size":344241,
      "type":"mms",
      "date":"2014-10-07 16:54:53"
   },
   {
      "id":"aad84d6e71",
      "name":"plik3.txt",
      "size":27,
      "type":"mms",
      "date":"2014-10-07 16:50:10"
   }]
}

Sending MMS

 

For using the remote operation to send an MMS message, call the specified URL using the POST method.

messages/send_mms

Available parameters

Parameter Type An example value or format Description
username String login Username used to dispatch the message
password String password

Password to the account

title String Title MMS Title MMS. Available is 40 characters.
file_id String|Array ID file

ID file can be downloaded by first upload and listing of available files for MMS. You can also send up to 10 files where their IDs will be sent using an array.

phone String|Array +48500600700 The number or telephone numbers provided in the table.
details Boolean true, false or none

The parameter displays in response to feedback details sent messages.

text String Contents The content of MMS. It will be automatically saved to a file and attached to the message.
date DateTime ISO
eg: „2010-11-09 15:23”

An optional parameter allows you to specify the date of dispatch of SMS messages.

test Boolean true, false or none An optional parameter, allowing you to check the question sending an SMS message. In response document is generated JSON / XML identical to the standard question, but the message is not sent.

 

The parameters in bold are obligatory. Others are optional.

Return generated after the message is the same as the regular sending of SMS messages.

{
   "success":true,
   "queued":2,
   "unsent":2,
   "items":[{
      "id":"32039da8e9",
      "phone":"+48500600700",
      "status":"queued",
      "queued":"2014-10-20 12:32:52",
      "parts":1,
      "text":"Title MMS"
   },
   {
      "id":"844c2b4af0",
      "phone":"+48500600500",
      "status":"queued",
      "queued":"2014-10-20 12:32:52",
      "parts":1,
      "text":"Title MMS"
   },
   {
      "id":"6e373d7856",
      "phone":"45616",
      "status":"unsent",
      "queued":"2014-10-20 12:32:52",
      "error_code":3103,
      "error_message":"Incorrect number",
      "text":"Title MMS"
   },
   {
      "id":"bf069fe2c1",
      "phone":"7799123",
      "status":"unsent",
      "queued":"2014-10-20 12:32:52",
      "error_code":3103,
      "error_message":"Incorrect number",
      "text":"Title MMS"
   }]
}

Recommended settings

In the case of medium and large amounts of messages sent several thousand or more, it is recommended to transfer messages in "packages" after about 50-200 numbers in a single query. This will speed up considerably the process of transferring the data to SerwerSMS.pl and reduce the amount necessary to send queries.

If you send the same attachment, it is optimal to his one-time upload and then use his identifier for subsequent dispatch messages.