System – Get Gateway Rates

System – Get Gateway Rates

Get Gateway Rates. Requires “get_rates” API permission.GET https://androidapi.net/api/get/rates

Parameter #

FieldTypeDescription
secretStringThe API secret you copied from (Tools -> API Keys) page

Success Response Format #

FieldTypeDescription
statusNumberList of Codes
200 = Success
messageStringResponse message
dataArrayArray of data

Error Response Format #

NameTypeDescription
statusNumberList of Codes
400 = Invalid parameters
401 = Invalid API secret
403 = Access denied
500 = Something went wrong
messageStringResponse message
dataArrayArray of data

PHP Sample #

<?php

  $apiSecret = "API_SECRET"; // your API secret from (Tools -> API Keys) page

  $cURL = curl_init();
  curl_setopt($cURL, CURLOPT_URL, "https://androidapi.net/api/get/rates?secret={$apiSecret}");
  curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($cURL);
  curl_close($cURL);

  $result = json_decode($response, true);

  // do something with response
  print_r($result);

Python Sample #

import requests

# your API secret from (Tools -> API Keys) page
apiSecret = "API_SECRET"

r = requests.get(url = "https://androidapi.net/api/get/rates", params = {
    "secret": apiSecret
})
  
# do something with response object
result = r.json()

Successful Response #

{
  "status": 200,
  "message": "Gateway Rates",
  "data": {
       "gateways": [
           {
               "id": 1,
               "name": "Twilio",
               "currency": "GBP",
               "pricing": {
                   "default": "0.01",
                   "countries": {
                       "us": "0.01",
                       "ph": "10",
                       "gb": "0.02"
                   }
               }
           }
       ],
       "partners": [
           {
               "unique": "00000000-0000-0000-d57d-f30cb6a89289",
               "name": "F11 Phone",
               "version": "Android 11",
               "priority": false,
               "sim": [
                   "2"
               ],
               "country": "PH",
               "currency": "PHP",
               "rate": 5,
               "owner": "mail@owneremail.com",
               "status": "online"
           }
       ]
   }
}

Error Response #

{
  "status": 400,
  "message": "Invalid Parameters!",
  "data": false
}

Leave A Comment