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
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 |
destinations | ARRAY | YES | An Array of the recipient(s). Indexes destination and msgid(client's transaction id). For SMS, the numbers can be in the international Format or local Format. Eg: 233553019529 or 0553019529 |
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). |
service | STRING | YES | The preferred service of the message. options SMS, EMAIL and VOICE (Voice option converts message field to speech). |
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 | YES | The sms type for the SMS sercice. Options text or flash. |
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. |
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": "PASSWORD",
"senderid": "SENDERID" ,
"destinations": [
{
"destination": "233553019529",
"msgid": 101 //client's transaction id
}
],
"message": "Hello API test message",
"service": "SMS", //(SMS | EMAIL | VOICE)
"subject": "Hello World",
"fromemail": "email@email.com", //optional. Use only for EMAIL
"smstype": "text", //optional. Use only for 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',
'message' => 'Your Message',
'service' => 'SMS',
'smstype' => 'text',
'subject' => 'Message Subject',
'destinations' => [
[
'destination' => '233553019529',
'msgid' => 101
]
]
];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://frog.wigal.com.gh/api/v2/sendmsg",
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";
}