SOAP / Sending SMS messages with the same content

Call address

 

To send an SMS message using the Remote Service, use the following code and send the appropriate parameters.{

require_once('lib/nusoap.php');

try {

  $wsdl_url = 'https://soap.serwersms.pl/server.php?wsdl';

  $client = new nusoap_client($wsdl_url, 'wsdl');
  $client->setCredentials("demo", "demo", "basic");
  $result = $client->call('Messages.sendSms',
       array( '', 'test', 'test', array( 'test' => 1, 'details' => 1) ));

   var_dump($client->responseData,$result,$client->getError());
   exit;

  } catch(Exception $e) { var_dump($e);exit; } }

}

WARNING! To send an SMS FULL message fill in the sender field (alphanumeric name or number). If the sender parameter is omitted or its value is empty, an ECO type SMS will be sent. Filling the parameter of the sender determines whether ECO or FULL will be sent.

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
phone String|Array +48500600700 Number or table phones numbers .
text String content Message content.
flash Boolean true, false or none

An optional parameter.

test Boolean true, false or none

The optional parameter, so you can check out the question of sending SMS messages. In response document is generated JSON / XML identical to the standard question, but the message will not be sent. Useful for testing applications (debug).

sender String

The alphanumeric name of the sender for example. "INFORMATION" own name or number 4 or 9-digit.

The optional parameter allows you to change the sender field of SMS messages to almost any name or number. Each name of the sender must first be added to the Panel or API, and then approved by the administrator SerwerSMS.pl.
wap_push String Address URL or none An optional parameter.
utf Boolean true, false or none

An optional parameter allows you to send SMS FULL containing eg. Polish diacritics, Cyrillic, etc. Only available in SMS FULL. Using this option changes the maximum length of a single SMS from 160 to 70 characters.

details Boolean true, false or none The parameter displays in response to feedback details sent messages.
vcard Boolean true, false or none

An optional parameter, which allows sending messages VCARD.

speed Boolean 1, 0 or none

An optional parameter allows you to send an independent channel with the highest quality (extra charge). 

date DateTime ISO eg.
„2015-02-22 12:25:55”
An optional parameter allows you to specify the date of dispatch messages
unique_id String|Array eg. 6asTD3fif98gj An optional parameter allows you to define your own ID sent message.

The identifier can be a minimum of 3 characters and a maximum of 50 alphanumeric characters (a-z, A-Z, 0-9). For group mailings, another unique_id must be unique and the number unique_id must be consistent with the amount of numbers.

group_id String|Array eg. 123456789

ID or group IDs in the Customer Panel. These identifiers can be downloaded using action groups / index or by copying them from the editing group in the Customer Panel.

contact_id String|Array eg. 123456789

 

ID or IDs of contacts in the Customer Panel. These identifiers can be downloaded using the stock contacts / index.

dlr_url String

http://www.twojadres.pl/skrypt.php?smsid=#SMSID#&stan=#STAN#&data=#DATA# 

This parameter allows the transmission method Push delivery reports on URL the Client. Setting this option to query the API overrides that in the settings in the Customer Panel. The address should be passed in encrypted form by the urlencode (). Address to forward reports applies to all messages submitted for execution within a single query.

Available parameters:

#SMSID# - message ID
#STAN# - condition of delivery
#DATA# - date of status change
#PRZYCZYNA# - the reason for non-delivery messages

The parameters in bold are obligatory. Others are optional.

If you wish to send a message as a vCard (parameter "vcard = true"), the structure of the message must be in a particular format. An example of the Vcard format can be found in the generally available documentation on the Internet or using the Customer Panel and SMS form. The next tags in the Vcard message should be separated by a newline character.

The FULL SMS message that contains Polish special characters should be properly encoded in UTF-8 before sending. To send a message with Polish characters, the "utf = true" parameter must be set, the subscriber must be authorized to send SMS messages FULL and the sender field must be filled in (this means that an SMS FULL will be sent).

Return response

Depending on the data sent, SerwerSMS.pl will generate in the appropriate document in the JSON / XML format with information about the actions carried out. In the case of correctly sending an SMS message, the customer will receive, for example, the following information:

{
   "success":true,
   "queued":1,
   "unsent":0
}

If you provide an additional parameter details = true, the reply will be supplemented with the details of sent messages that can be saved in the database on the client software side:{
   "success":true,
   "queued":1,
   "unsent":0,
   "items":[{
        "id":"1c142d81c7",
        "phone":"+48500600700",
        "status":"queued",
        "queued":"2014-10-16 16:49:05",
        "parts":1,
        "text":"Test SerwerSMS.pl"
   }]
}

The "success" parameter contains information about the success of the operation. The "queued" and "unset" attributes include the number of queued and unsent messages. The "items" section contains telephone numbers and ID of messages to be sent (and messages that have not been queued for a specific reason). The unique SMS tag can be used later to check the status of sending a specific SMS message remotely. The "text" parameter shows the content of the sent SMS message. The telephone number is automatically corrected and displayed in the full format required by SerwerSMS.pl, ie with the country code (eg +48) at the beginning.

In the case of providing, for example, a wrong phone number, an error message will be generated as well as a message ID (so that you can check later when and why it was not sent). For example, if two correct numbers and two wrong numbers are given, the system will generate the following JSON document:

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

 

In addition, a general error can be generated where there is no delimitation to the queued and incorrect. This can happen, for example, when the customer does not define the message content, does not provide phone numbers, his account is not active or there is another problem described in the error messages. If you do not enter the message, the following message will be generated:

{
   "error":{
      "code":3101,
      "type":"SendError",
      "message":"The message is empty"
   }
}

and similarly if no phone numbers are provided:

{
   "error":{
      "code":3104,
      "type":"SendError",
      "message":"No specified phone numbers"
   }
}

Recommended settings

In the case of medium and large amounts of sent messages of a few thousand or more, it is recommended to forward messages in "packs" of about 50-200 numbers in one question. This will greatly speed up the process of data transfer to SerwerSMS.pl and reduce the number of queries necessary to send.

If you try to send messages to two or more of the same phone numbers in a single query, the system will only send a message once to that number.