Skip to content

Commit 060ccb3

Browse files
committed
Updated README.md
Updated README.md
1 parent 93dadfe commit 060ccb3

File tree

1 file changed

+159
-1
lines changed

1 file changed

+159
-1
lines changed

README.md

Lines changed: 159 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ composer require mobiweb/sdk
3535
* With MobiWeb SMS API you can send SMS messages to 7+ billion subscribers of 1000+ Mobile Operators in 200+ countries.
3636
* With MobiWeb HLR API you can maximize the performance of your campaigns and your business communication. Validate mobile number databases, remove invalid entries and receive correct portability information, identifying the operators that the mobile numbers belong to.
3737
* With MobiWeb OTP API you can provide additional security to simple username and password authentication, authenticated transactions, accurately verify users, reduce fraud and reduce two-factor authentication cost (no hardware tokens required).
38+
* With MobiWeb Asynchronous SMS API you can send SMS messages with high throughput, utilizing SMPP protocol.
3839

3940
The APIs are based on REST with built-in HTTP authentication and HTTP status codes. All data exchange is done in JSON format.
4041

41-
To test the APIs, you will need a valid API account. If you don't have one yet, [click here][apiaccount] to register for a FREE account.
42+
To test the SMS, OTP and HLR APIs, you will need a valid API account. If you don't have one yet, [click here][apiaccount] to register for a FREE account.
43+
44+
To test the Asynch SMS API, you will need a valid SMPP API account. If you don't have one yet, please contact us [here][smppaccount] to register for a FREE test account.
4245

4346
## Examples
4447

@@ -448,6 +451,160 @@ print_r($client->getPricing(MobiWeb\Rest\Client::OTP));
448451
?>
449452
```
450453

454+
### Asynchronous SMS API
455+
### Send a single SMS
456+
457+
```php
458+
<?php
459+
460+
//Your account username and password
461+
$username = "";
462+
$password = "";
463+
464+
$client = new MobiWeb\Rest\AsynchClient($username, $password);
465+
466+
//Submit message
467+
$message = $client->broadcast(
468+
[[
469+
"from" => "HelloWorld", //The sender displayed upon the SMS arrival. Can be composed of 2-11 alphanumeric characters (A-z,0-9, ,-,.) or 14 numeric characters (0-9). Special characters are not allowed.
470+
"to" => ["44xxxxxxxxxx"], //The full international number(s) of the recipient(s) in international E.164 format https://en.wikipedia.org/wiki/E.164.
471+
"message" => "Hello from MobiWeb!" //The text of the SMS message. If all characters in the message belong to the 3GPP GSM 7-bit GSM 03.38 ASCII character table https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38, you can send up to 160 characters in a single SMS. You can send longer messages automatically by setting message parameter with your preffered text. In long SMS (multi-part SMS), each SMS part can be up to 153 characters. Each part costs as 1 SMS. If one or more characters in the message belong to the 16-bit Unicode / UCS-2 character table https://en.wikipedia.org/wiki/UTF-16, because of the increased memory requirement for each character, you can send up to 70 characters in a single SMS. In long SMS (multi-part SMS), each SMS part can be up to 67 characters. Each part costs as 1 SMS.
472+
473+
]]
474+
);
475+
476+
//Print message
477+
print_r($message);
478+
479+
?>
480+
```
481+
482+
### Send multiple SMS
483+
484+
```php
485+
<?php
486+
487+
//Your account username and password
488+
$username = "";
489+
$password = "";
490+
491+
$client = new MobiWeb\Rest\AsynchClient($username, $password);
492+
493+
$message = $client->broadcast(
494+
[[
495+
"from" => "HelloEx1", //The sender displayed upon the SMS arrival. Can be composed of 2-11 alphanumeric characters (A-z,0-9, ,-,.) or 14 numeric characters (0-9). Special characters are not allowed.
496+
"to" => ["44xxxxxxxxxx"], //The full international number(s) of the recipient(s) in international E.164 format https://en.wikipedia.org/wiki/E.164.
497+
"message" => "Hello from MobiWeb 1!" //The text of the SMS message. If all characters in the message belong to the 3GPP GSM 7-bit GSM 03.38 ASCII character table https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38, you can send up to 160 characters in a single SMS. You can send longer messages automatically by setting message parameter with your preffered text. In long SMS (multi-part SMS), each SMS part can be up to 153 characters. Each part costs as 1 SMS. If one or more characters in the message belong to the 16-bit Unicode / UCS-2 character table https://en.wikipedia.org/wiki/UTF-16, because of the increased memory requirement for each character, you can send up to 70 characters in a single SMS. In long SMS (multi-part SMS), each SMS part can be up to 67 characters. Each part costs as 1 SMS.
498+
499+
],
500+
[
501+
"from" => "HelloEx2",
502+
"to" => ["44xxxxxxxxxx"],
503+
"message" => "Hello from MobiWeb 2!"
504+
505+
]]
506+
);
507+
508+
//Print message
509+
print_r($message);
510+
511+
?>
512+
```
513+
514+
### Send SMS with all options
515+
516+
```php
517+
<?php
518+
519+
//Your account username and password
520+
$username = "";
521+
$password = "";
522+
523+
$client = new MobiWeb\Rest\AsynchClient($username, $password);
524+
525+
$message = $client->broadcast(
526+
[[
527+
"from" => "HelloWorld", //The sender displayed upon the SMS arrival. Can be composed of 2-11 alphanumeric characters (A-z,0-9, ,-,.) or 14 numeric characters (0-9). Special characters are not allowed.
528+
"to" => ["44xxxxxxxxxx"], //The full international number(s) of the recipient(s) in international E.164 format https://en.wikipedia.org/wiki/E.164.
529+
"message" => "Hello from MobiWeb!", //The text of the SMS message. If all characters in the message belong to the 3GPP GSM 7-bit GSM 03.38 ASCII character table https://en.wikipedia.org/wiki/GSM_03.38#GSM_7-bit_default_alphabet_and_extension_table_of_3GPP_TS_23.038_/_GSM_03.38, you can send up to 160 characters in a single SMS. You can send longer messages automatically by setting message parameter with your preffered text. In long SMS (multi-part SMS), each SMS part can be up to 153 characters. Each part costs as 1 SMS. If one or more characters in the message belong to the 16-bit Unicode / UCS-2 character table https://en.wikipedia.org/wiki/UTF-16, because of the increased memory requirement for each character, you can send up to 70 characters in a single SMS. In long SMS (multi-part SMS), each SMS part can be up to 67 characters. Each part costs as 1 SMS.
530+
531+
"options" => [
532+
"receive_dlr" => "1", //Set this parameter to ‘1’ for requesting delivery report for this SMS. Refer to receive Delivery Reports section for more information . https://api.solutions4mobiles.com/sms-api.html#receive_delivery_reports
533+
"message_type" => "sms", //The type of the SMS message.
534+
"reference_code" => "ABCD1234", //Set this parameter to your preferred reference id / custom data for this submission. Length can be up to 50 characters.
535+
"schedule_date" => "", //Set this parameter in format "yyyy-mm-dd hh:mm:ss" UTC +0 to schedule your sending to a future datetime. Must be at least 20 minutes from now.
536+
"expire_date" => "" //Set this parameter in format "yyyy-mm-dd hh:mm:ss" UTC +0 to force expiration of your SMS to a future datetime. Must be at least 30 minutes from now and schedule_date.
537+
]
538+
539+
]]
540+
);
541+
542+
//Print message
543+
print_r($message);
544+
545+
?>
546+
```
547+
548+
### Get account balance
549+
550+
```php
551+
<?php
552+
553+
//Your account username and password
554+
$username = "";
555+
$password = "";
556+
557+
$client = new MobiWeb\Rest\AsynchClient($username, $password);
558+
559+
//Get account balance and print it
560+
echo $client->getBalance();
561+
562+
?>
563+
```
564+
565+
### Get account pricing
566+
567+
```php
568+
<?php
569+
570+
//Your account username and password
571+
$username = "";
572+
$password = "";
573+
574+
$client = new MobiWeb\Rest\AsynchClient($username, $password);
575+
576+
//Get account pricing and print it
577+
print_r($client->getPricing(MobiWeb\Rest\AsynchClient::SMS));
578+
579+
?>
580+
```
581+
582+
### Receive message status notifications and delivery reports
583+
584+
Status notifications of messages processed and elivery reports are forwarded automatically, to the user system / platform. When a message is processed by our SMS API Platform, the status information is immediately forwarded to your specified DLR Callback URL (specified when setting up your Asynch SMS API Account) via a POST request.
585+
586+
```php
587+
<?
588+
589+
//For information about receiving message status notifications and delivery reports please visit https://api.solutions4mobiles.com/asynchronous-sms-api.html#receive_status_notifications
590+
591+
//Get request
592+
$inputJSON = file_get_contents('php://input');
593+
594+
//convert JSON into array
595+
$input= json_decode( $inputJSON, TRUE );
596+
597+
//print data
598+
print_r($input);
599+
600+
//Return successful http code
601+
header('HTTP/1.1 200 OK', true, 200);
602+
// or error
603+
// header('HTTP/1.1 500 Internal Server Error', true, 500);
604+
605+
?>
606+
```
607+
451608
## Getting help
452609

453610
If you need help installing or using the library, please [contact us][MobiWebSupportCenter].
@@ -456,5 +613,6 @@ If you've instead found a bug in the library or would like new features added, g
456613

457614
[apidocumentation]: https://api.solutions4mobiles.com/sms-api.html
458615
[apiaccount]: https://www.solutions4mobiles.com/product/sms-messaging
616+
[smppaccount]: mailto:[email protected]?subject=Asynchronous+SMS+API+Test+Account+Request&amp;body=Dear+Team,+please+provide+me+with+a+test+account+for+the+Asynchronous+SMS+API.
459617
[webpanel]: https://sms.solutions4mobiles.com
460618
[MobiWebSupportCenter]: https://www.solutions4mobiles.com/support

0 commit comments

Comments
 (0)