Get Bank Details
This API is used to fetch details of all Nigerian banks stored in our database. Below are the fields that are to be sent via API using POST
Method to the Url:
For Staging: http://test-api.atarapay.com/api/external/getBanks
for live: https://api.atarapay.com/api/external/getBanks
Field name | Required | Description |
---|---|---|
authtoken | Yes | This is calculated using the steps mentioned here Calculation of Auth Token |
Successfull Response
{
"status": "success",
"message": "available_banks",
"data": [
{
"id": 1,
"name": "Abbey Mortgage Bank",
"code": "***",
"nip_bank_code": "***",
"created_at": "2021-04-14 16:43:08",
"updated_at": "2021-04-14 16:43:08"
},
{
"id": 2,
"name": "Access Bank",
"code": "***",
"nip_bank_code": "***",
"created_at": "2021-04-14 16:43:08",
"updated_at": "2021-04-14 16:43:08"
},
......
{
"id": 51,
"name": "Wema Bank",
"code": "***",
"nip_bank_code": "***",
"created_at": "2021-04-14 16:43:08",
"updated_at": "2021-04-14 16:43:08"
},
{
"id": 52,
"name": "Zenith Bank",
"code": "***",
"nip_bank_code": "***",
"created_at": "2021-04-14 16:43:08",
"updated_at": "2021-04-14 16:43:08"
}
]
}
Failure Response
{
"status": "error",
"message": "The authtoken field is required."
}
Sample codes
C#
var client = new RestClient("http://test-api.atarapay.com/api/external/getBanks");
var request = new RestRequest(Method.POST);;
request.AddHeader("cache-control", "no-cache");
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "authtoken=__Auth_token_calculated__", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
PHP
$request = new HttpRequest();
$request->setUrl('http://test-api.atarapay.com/api/external/getBanks');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'cache-control' => 'no-cache',
'content-type' => 'application/x-www-form-urlencoded'
));
$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
'authtoken' => '__Auth_token_calculated__'
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
Node Js
var unirest = require("unirest");
var req = unirest("POST", "http://test-api.atarapay.com/api/external/getBanks/");
req.headers({
"cache-control": "no-cache",
"content-type": "application/x-www-form-urlencoded"
});
req.form({
"authtoken": "__Auth_token_calculated__"
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});