النسخة العربية
لعرض النسخة باللغة العربية اضغط هنا
Introduction
To use Unifonic REST API, you will need a Unifonic account, an application ID (AppSid), and a registered sender.
Below is a Hello World guide to help you quickly hack around sending SMS messages via Unifonic.
URL: https://el.cloud.unifonic.com/rest/SMS/messages
Method: POST
Unifonic API requires data to be JSON formatted. All requests must use the Content-type header set to application/json.
In the API request, you need to include the following parameters:
Parameter | Decription | Example Value |
---|---|---|
AppSid | Authentication string that uniquely identifies your application. | 6v253153sxxxxxxxx |
SenderID | The SenderID identifies who has sent the SMS message, typically a brand name; in case of not adding this parameter, the system will use the default SenderID | Sender |
Recipient | Destination mobile number, mobile numbers must be in international format without 00 or + Example: (9660000000000) | 9660000000000 |
Body | Message body. Supports both English and Unicodes characters e.g. Arabic. | Hello world! |
API Request Example
curl --location --request POST 'https://el.cloud.unifonic.com/rest/SMS/messages' \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'AppSid=6v253153xxxxxxxx' \
--data-urlencode 'SenderID=UNISMS' \
--data-urlencode 'Body=Hello there' \
--data-urlencode 'Recipient=9660000000000'
API response example
{
"success": true,
"message": "",
"errorCode": "ER-00",
"data": {
"MessageID": 42000348806924,
"CorrelationID": "CorrelationID",
"Status": "Sent",
"NumberOfUnits": 0,
"Cost": 0,
"Balance": 0,
"Recipient": "9660000000000",
"TimeCreated": "2022-09-06 14:06:25.979",
"CurrencyCode": ""
}
}
{
"success": false,
"message": "Dest num is too short",
"errorCode": "ER-04",
"data": {}
}
Related Link| SMS Userguide