HTTP API v1.0 Documentation
With MS Group API 1.0 it is possible to integrate SMS information into your site or CRM system.
Automatically notify your users of a balance change, order delivery or other significant event.
All requests are available via HTTP GET method.
Send message
Send SMS messagessendsms.php
Parameter | Format | Use | Description |
---|---|---|---|
username | string | Required | Nickname |
password | string | Required | Password |
client_id | integer | Required | User unique identifier |
service_id | integer | Required | Sender ID |
to | string | Required | Phone number in international format |
text | string | Required | Message body, (7bit encoding 160 characters, unicode 70 charaters) |
utf | integer | Optional | Sending with Unicode (Georgian) characters |
result | string | Optional | json - response returned in JSON format xml - response returned in XML format Default is simple text format as "CODE-MESSAGE_ID" |
Attention! If you send Georgian (unicode) text and do not specify the utf parameter, the user
will receive "?" in message text instead of Georgian characters.
Example of sending a message:
curl http://bi.msg.ge/sendsms.php?to=995599XXXXXX&text=your+text&service_id=1&client_id=1&password=your+password&username=your+nickname&utf=1
The status code and message identifier are returned in response:
0000-000001
Meaning of Response Codes:
Code | Description |
---|---|
0000 | Message sent request accepted. Second parameter is message unique identifier in the system. This status does not mean that the message has been delivered to the subscriber. |
0001 | Invalid password or nickname or restricted IP address |
0003 | Required fields are empty (username, password, client_id, service_id) |
0005 | Blank message body |
0007 | Invalid phone number |
0008 | Insufficient balance |
0009 | Invalid sender ID |
0010 | The message contains banned word |
Sending messages from Shared hosting and CLOUD servers
If your service is located on servers that have multiple IP addresses, you should notify your manager about it and the latter will provide you with an alternate password that you can provide in the header in the MSG_HEADER as setting
Example of request formatting on PHP
$opts = array( 'http'=>array( 'method'=>"GET", 'header'=>"MSG_HEADER: your alternate password" ... ) ); $context = stream_context_create($opts); $file = file_get_contents('http://bi.msg.ge/sendsms.php? to=995599000000& text=your+text& service_id=1& client_id=1& password=your+password& username=your+nickname', false, $context); // Replace settings with your real data provided by our service manager
Check message delivery status
Check SMS message delivery statustrack.php
Parameter | Format | Use | Description |
---|---|---|---|
message_id | integer | Required | Unique identifier of sended message |
username | string | Required | Nickname |
password | string | Required | Password |
client_id | integer | Required | User unique identifier |
Example of verifying notification status with GET method:
curl http://bi.msg.ge/track.php?message_id=1&client_id=1&password=your+password&username=your+nickname
The status code is returned in response:
1
Meaning of error codes:
Code | Description |
---|---|
0 | Pending |
1 | Was sent to a subscriber |
2 | Failed to sent to a subscriber |
4 | Status pending |
8 | Submitted to the SMS Center |
16 | Rejected by SMS Center |
64 | Incorrect password or nickname or restricted IP address |