FROG Rest API v2

Introduction

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.

QUERY MESSAGES API

Instructions

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.

Query API Endpoint: POST
							
    https://frog.wigal.com.gh/api/v2/query
							
                        
Header Data
Field / Parameter Value Coding Format Required Description
Content-Type application/json UTF-8 YES this is needed to encode to UTF-8
Payload Description
Parameters Type Required Description
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.
query STRING YES The type of query you want to send to our gateway. For Balance checking use 'balance' and for Mesages use 'messages'
msgid INTEGER NO The transaction id that was used to save the messages. (provided by client during message send). For messages query option only. Optional
batchid INTEGER NO The batch id that was used to save the messages. (provided by FROG during message send). For messages query option only. Optional
status STRING NO The status of the messages. (DELIVRD, UNDELIVRED, ACCEPTD, REJECTD, APPROVED, FAILED, WAITING). For messages query option only. Optional
datefrom STRING NO The date range start date if you would like to filter by date. For messages query option only. Optional
dateto STRING NO The date range end date if you would like to filter by date. For messages query option only. Optional

NB: On a successful query on your balance, the API will return an integer representing your current balance. Eg; 500, 150, or 0.

Sample Payload:
							
    {
        "username": "yourusername",
        "password": "yourpassword",
        "query": "balance" //for balance checking
    }

    or 

    {
        "username": "yourusername",
        "password": "yourpassword",
        "query": "messages" //for message filtering
        "msgid":"101" //Optional.
        "batchid":"77" //Optional.
        "status":"FAILED" //Optional.
        "datefrom":"2020-01-01" //Optional.
        "dateto":"2020-02-02" //Optional.
    }
							
                        
Sample Response:
							
{ 
    "status":"OK",
    "results": [
            {
                "topup": 10,
            },
            {
                "bundles": [],
            }
        ]
}
							
                        
Query Example:
							
                                

PHP

    $messagedata = [
        'username' => 'yourusername',
        'password' =>'yourpassword',
        'query' => 'messages',
        //'msgid' => '101',
        //'batchid' => '77',
        //'status' => 'FAILED',
        'datefrom' => '2020-01-01',
        'dateto' => '2020-02-02'
    ];

    $curl = curl_init();
 
    curl_setopt_array($curl, array(
        CURLOPT_URL => "https://frog.wigal.com.gh/api/v2/query",
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_ENCODING => "",
        CURLOPT_MAXREDIRS => 10,
        CURLOPT_TIMEOUT => 30,
        CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
        CURLOPT_CUSTOMREQUEST => "POST",
        CURLOPT_POSTFIELDS => $messagedata,
        CURLOPT_HTTPHEADER => array(
            "Content-Type: application/json"
        ),
    ));
    
    $response = curl_exec($curl);
    $err = curl_error($curl);

    curl_close($curl);

    if ($err) {
        return "request could not be queried";
    }else {
        if($response->status == 'OK'){
            return $response->results; 
        }else{
            return "request could not be queried";
        }
    }