Operators Data
This page provides information about the operators data used in the Nowallet API. The operators data is used to identify the operator code and its corresponding currency for payment transactions.
To get the list of operators supported by each country code, you can use the following endpoint:
{baseUrl}/operators/dataFor example, if you want to get specific operators about Cameroon, you can use the following URL:
{baseUrl}/operators/data?country=CM.
Request Parameters
When retrieving the operators data, the request must include the following parameters in the URL:
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| country | query | string | true | country code will be checked |
Code Samples in Multiple Languages
To help you integrate the NoWallet API seamlessly, we provide code samples in various programming languages. These examples demonstrate how to make a request to the API endpoint and handle the response.
- Shell (cURL): For quick testing and command-line usage.
- HTTP: Raw HTTP request format for understanding the structure.
- JavaScript: Using
fetchfor browser or Node.js environments. - Ruby: Using the
rest-clientlibrary for Ruby applications. - Python: Using the
requestslibrary for Python projects. - PHP: Using
GuzzleHttpfor PHP integrations. - Java: Using
HttpURLConnectionfor Java applications. - Go: Using the
net/httppackage for Go projects.
Example Request
Below is an example of how to retrieve the operators data using different languages. Select the tab corresponding to your preferred language to view the implementation.
Ensure you replace {access-token} with your actual API token and provide the required request parameters.
- cURL
- HTTP
- JavaScript
- Ruby
- Python
- PHP
- Java
- Go
# Exemple de commande cURL pour obtenir les données des opérateurs
curl -X GET {baseUrl}/operators/data?country=string \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
GET {baseUrl}/operators/data?country=string HTTP/1.1
Accept: application/json
const headers = {
Accept: "application/json",
Authorization: "Bearer {access-token}",
};
fetch("{baseUrl}/operators/data?country=string", {
method: "GET",
headers: headers,
})
.then(function (res) {
return res.json();
})
.then(function (body) {
console.log(body);
});
require 'rest-client'
require 'json'
headers = {
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}'
}
result = RestClient.get '{baseUrl}/operators/data',
params: {
'country' => 'string'
}, headers: headers
p JSON.parse(result)
import requests
headers = {
'Accept': 'application/json',
'Authorization': 'Bearer {access-token}'
}
r = requests.get('{baseUrl}/operators/data', params={
'country': 'string'
}, headers = headers)
print(r.json())
<?php
require 'vendor/autoload.php';
$headers = array(
'Accept' => 'application/json',
'Authorization' => 'Bearer {access-token}',
);
$client = new \GuzzleHttp\Client();
// Define array of request body.
$request_body = array();
try {
$response = $client->request('GET','{baseUrl}/operators/data', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
}
// ...
URL obj = new URL("{baseUrl}/operators/data?country=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response.toString());
package main
import (
"bytes"
"net/http"
)
func main() {
headers := map[string][]string{
"Accept": []string{"application/json"},
"Authorization": []string{"Bearer {access-token}"},
}
data := bytes.NewBuffer([]byte{jsonReq})
req, err := http.NewRequest("GET", "{baseUrl}/operators/data", data)
req.Header = headers
client := &http.Client{}
resp, err := client.Do(req)
// ...
}
Response Parameters
The response from the API will include the following parameters:
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | operator fetched successfully | Inline |
| 400 | Bad Request | Bad Request possible errors | None |
Response Types
The response from the API will include the following parameters in JSON format:
Success Response (200 OK)
Example response for a successful request
{
"name": "MTN MONEY",
"codeoperator": "MTN",
"logo": "https://www.example.com/assets/img/MTN.png",
"code": {
"MERCHANT": "ORANGEMONEYMERCHANTCODE",
"CASHIN": "ORANGEMONEYCASHINCODE",
"CASHOUT": "none"
},
"startwith": ["01", "02"],
"otpstarter": {
"MERCHANT": false,
"CASHIN": false,
"CASHOUT": false
},
"active": true,
"secure": {
"MERCHANT": false,
"CASHIN": false,
"CASHOUT": false
},
"instruction": {}
}
Error Response (400 Bad Request)
Bad Request possible errors
{
"statusCode": 400,
"error": "COUNTRY_CODE_NOT_FOUND",
"message": "It seems that this country code does not exist or You can't perform this action, this token does not allow you"
}
Was this page helpful?