SMS informations

API can be used for retrieving informations about SMS.

Basic description and parameters of API calls can be found on this page.

Service

SMS API belongs to SMS service (sms).

API request

API request must contain all general parameters.

CTRL

Fixed value: sms_info

id
Identifier retrieved from response to SMS sending.

API request examples

example 1: Getting SMS informations (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "sms_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "sms",
  "_call" => $call,

  "id" => 146, 
));

/**
URL
https://api.profisms.cz/index.php?CTRL=sms&_login=user
  &_password=5ec91cfbcbdcdf55748400c8006debd1&_service=sms
  &_call=b338a71d833a9c8c4349d392d7ae1e2fb7bcb3ad4d1a519a989716.38230669
  &id=146
*/

$json = join("", file($url));
  

Response to valid API request

Basic response can be found in general API description.

Data object description

Object data contains following parameters:

id

SMS unique identifier (it is not sequence number).

Value is a number at this point, but this parameter will change type to string in the future.

This identifier is used for passing delivery reports and for SMS informations requests.

state
SMS state.
delivery
SMS delivery state.
type
SMS type.
msisdn
Destination phone number (formated as international).
name
SMS name (in case of wappush)
text
SMS text.
validity
Number of minutes this SMS is valid for.
queued
Date and time SMS was queued (yyyy-mm-dd hh:ii:ss).
delivered
Date and time when SMS delivery state changed (yyyy-mm-dd hh:ii:ss). Regardless of delivery state (whether SMS was delivered or not).
part

Array of SMS parts unique identifiers (it is not sequence number).

Values in array are numbers at this point, but will change type to string in the future.

partsCount
Number of SMS parts for each SMS. Parameter does not represents all SMS parts created by this request. This value is based on valid destination numbers.
address
Delivery report address (based on delivery or address parameters in request).
source

Sender's number or identifier.

account
Account unique number (account used for billing)

Objects in array part

Objects in array part have following parameters:

id

SMS parts unique identifier (it is not sequence number).

Values in array are numbers at this point, but will change type to string in the future.

state
SMS part state.
delivery
SMS part delivery state.
queued
Date and time SMS part was queued (yyyy-mm-dd hh:ii:ss).
delivered
Date and time when SMS part delivery state changed (yyyy-mm-dd hh:ii:ss). Regardless of delivery state (whether SMS part was delivered or not).

Request and response examples

example 2: Request (PHP implementation)
$login = 'user';
$call = microtime(true);
$password = md5(md5("heslo").$call);

$url = "https://api.profisms.cz/index.php?" . http_build_query(array(
  "CTRL" => "sms_info",
  "_login" => $login,
  "_password" => $password,
  "_service" => "sms",
  "_call" => $call,

  "id" => '1544185',
));
  
example 3: SMS queued and sent and delivered
{
  "error":
  {
    "code":0,
    "message":"OK"
  },
  "data":
  {
    "id":"1544185",
    "state":"sent",
    "delivery":"delivered",
    "type":"text",
    "msisdn":"+420605582922",
    "name": "",
    "text": "p\u0159\u00edli\u0161 \u017elu\u0165ou\u010dk\u00fd k\u016f\u0148 \u00fap\u011bl \u010f\u00e1belsk\u00e9 ody, p\u0159\u00edli\u0161 \u017elu\u0165ou\u010dk\u00fd k\u016f\u0148 \u00fap\u011bl \u010f\u00e1belsk\u00e9 ody",
    "validity":5,
    "queued":"2010-12-28 17:54:05",
    "delivered":"2010-12-28 17:55:00",
    "part":
    [
      {
        "id":"44109244",
        "state":"sent",
        "delivery":"delivered",
        "queued":"2010-12-28 17:54:05",
        "delivered":"2010-12-28 17:55:00"
      },
      {
        "id":"44109245",
        "state":"sent",
        "delivery":"delivered",
        "queued":"2010-12-28 17:54:05",
        "delivered":"2010-12-28 17:55:00"
      }
    ],
    "address": "http:\/\/tmp.company.cz\/tmp.php",
    "partsCount": 2,
    "source":"ztestu",
    "account":"123456"
  },
  "_key":"ab2063832062b63434a93f091e16df2b",
  "_time":0.229101896286
}
  

Similarly to sending delayed SMS, if such SMS was not sent yet, array part will be empty.

example 4: Response dor delayed SMS
{
  "error":
  {
    "code":0,
    "message":"OK"
  },
  "data":
  {
    "id":"1561947",
    "state":"inserted",
    "delivery":"nostate",
    "type":"text",
    "msisdn":"+420605582922",
    "name": "",
    "text": "p\u0159\u00edli\u0161 \u017elu\u0165ou\u010dk\u00fd k\u016f\u0148 \u00fap\u011bl \u010f\u00e1belsk\u00e9 ody, p\u0159\u00edli\u0161 \u017elu\u0165ou\u010dk\u00fd k\u016f\u0148 \u00fap\u011bl \u010f\u00e1belsk\u00e9 ody",
    "validity":5,
    "queued":"",
    "delivered":"",
    "part":[],
    "address": "http:\/\/tmp.company.cz\/tmp.php",
    "partsCount": 2,
    "source":"ztestu",
    "account":""
  },
  "_key":"5f848e3b6876d1df0800ad6dced92633",
  "_time":0.0822818279266
}
  

Response to invalid request

ID error

User can request only SMS, user created. In case of invalid ID (not existing, or belonging to other user), no error occurs, but empty object is returned (mainly id property is zero).

example 5: Response for invalid ID
{
  "error":
  {
    "code":0,
    "message":"OK"
  },
  "data":
  {
    "msisdn":"",
    "id":0,
    "state":"queued",
    "delivery":"nostate",
    "queued":"",
    "delivered":"",
    "part":[],
    "address": "",
    "partsCount": 0
  },
  "_key":"6248cfb5d0c42b8da78b062b0dae9053",
  "_time":0.0802619457245
}
  

Request error

Description can be found in general API description.