This Document gives details on how to send SMS, EMAILS, and Voice Messages via the FROG API Solutions from your application.
NB: To be able to connect via the API, you must first register on the FROG Platform and use your user credentials.
Every user trying to use this API must ensure that, they have access to their valid Username and Password and also be certain that their Senderid has been approved.
NB: One can verify on their senderid approval status, by logging into their account portal, by using their valid username
and password
.
POST
https://frog.wigal.com.gh/api/v2/sendmsg/list
Field / Parameter | Value | Coding Format | Required | Description |
---|---|---|---|---|
Content-Type | application/json | UTF-8 | YES | this is needed to encode to UTF-8 |
Parameters | Type | Required | Description |
---|---|---|---|
senderid | STRING | YES | The sender ID. Max is 11 characters. Eg: WIGAL |
messagelist | ARRAY | YES | An Array of the recipient(s) and individual messages. View Message List Table below to view array parameters. |
service | STRING | YES | The preferred service of the message. options SMS, EMAIL and VOICE (Voice option converts message field to speech). |
username | STRING | YES | This is the username; you use in logging into your FROG portal. |
password | STRING | YES | This is the password; you use in logging into your FROG portal. |
Parameters | Type | Required | Description |
---|---|---|---|
message | STRING | YES | The content of message to send (Can be used for 'long' messages, that is, messages longer than 160 characters for plain text). |
subject | STRING | NO | The Subject of the message to send. |
fromemail | STRING | NO | The send from email if any. This is only for the EMAIL service. (Please note that specifying this field without a custom email setting specified on FROG could lead to your message ending up in the recipient's spam folder.) |
smstype | STRING | NO | The sms type for the SMS sercice. Options text or flash. |
msgid | STRING | YES | This is the client's transaction id. |
destination | STRING | YES | This is the recipient destination. For SMS, the numbers can be in the international Format or local Format. Eg: 233553019529 or 0553019529 |
Status | Message returned by API |
---|---|
ACCEPTED | "Message Accepted For Processing" |
REJECTED | Invalid Login credentials |
REJECTED | Message Could not be sent. |
REJECTED | Invalid request data. |
REJECTED | Service not recognized. |
REJECTED | "Invalid Sender ID. No such Sender ID linked to Account." |
REJECTED | Client Account blacklisted. |
{
"username": "USERNAME",
"password": "PASWORD",
"senderid": "SENDERID" ,
"service": "SMS", //(SMS | EMAIL | VOICE)
"messagelist": [{
"destination": "233553019529",
"msgid": 101, //client's transaction id
"message": "Hello my API message",
"subject": "Hello World",
"fromemail": "email@email.com", //optional. Use only for service EMAIL
"smstype": "text" //optional. Use only for service SMS (text | flash)
},{
"destination": "233553019529",
"msgid": 102, //client's transaction id
"message": "Hello my API message 2",
"subject": "Hello World 2",
"fromemail": "email@email.com", //optional. Use only for service EMAIL
"smstype": "flash" //optional. Use only for service SMS (text | flash)
}]
}
{
"status":"ACCEPTED",
"batchid": 77,
"destinations": [
{
"msgid": 101,
"status": "ACCEPTED",
"reason": "Accepted For Processing."
}
],
"reason":"Message Accepted For Processing"
}
PHP
$messagedata = [
'username' => 'yourusername',
'password' =>'yourpassword',
'senderid' => 'SENDERID',
'service' => 'SMS',
'messagelist' => [
[
'destination' => '233553019529',
'msgid' => 101,
'smstype' => 'text',
'subject' => 'Message Subject',
'message' => 'Your Message'
]
]
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://frog.wigal.com.gh/api/v2/sendmsg/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode($messagedata),
CURLOPT_HTTPHEADER => array(
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
$response = json_decode($response);
if(!$err || $err=="") {
if($response->status == 'ACCEPTED'){
echo "message accepted for sending";
}else{
echo "message could not be sent";
}
}else {
echo "message could not be sent";
}