Operator List
Authentication
Basic Authentication
- Username: Client Id
- Password: Secret Key
Example Authorization Header:
Authorization: Basic eGV0dGxlXzgzMjg2NjU5YmRmNzBkZWEzMDUwMzcwNzE1MTYwMzA0MDo3YzE1ZDQyYTZhYjEyOTYzYWI4NzJhMzFkOTk4MDk1ZDMwNTAzNzA3MTUxNjMyMDg5
Request Body
{}
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
operatorType | string | Yes | Type of operator (e.g., "prepaid", "postpaid", "dth") |
circle | string | Yes | Telecom circle or region (e.g., "mumbai", "delhi") |
Request Examples
Request Examples
- Curl
- JavaScript
- C#
- Java
- Python
curl --location 'https://xyz.com/v1/service/recharge/operators' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YOUR_AUTH_TOKEN'
const axios = require('axios');
async function getOperators() {
try {
const response = await axios.post('https://xyz.com/v1/service/recharge/operators', {}, {
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic YOUR_AUTH_TOKEN'
}
});
console.log(response.data);
} catch (error) {
console.error('Error fetching operators:', error);
}
}
getOperators();
var options = new RestClientOptions("https://xyz.com")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("/v1/service/recharge/operators", Method.Get);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Basic eGV0dGxlXzgzMjg2NjU5YmRmNzBkZWEzMDUwMzcwNzE1MTYwMzA0MDo3YzE1ZDQyYTZhYjEyOTYzYWI4NzJhMzFkOTk4MDk1ZDMwNTAzNzA3MTUxNjMyMDg5");
var body = @"";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://xyz.com/v1/service/recharge/operators")
.method("GET", body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Basic eGV0dGxlXzgzMjg2NjU5YmRmNzBkZWEzMDUwMzcwNzE1MTYwMzA0MDo3YzE1ZDQyYTZhYjEyOTYzYWI4NzJhMzFkOTk4MDk1ZDMwNTAzNzA3MTUxNjMyMDg5")
.build();
Response response = client.newCall(request).execute();
import requests
import json
url = "https://xyz.com/v1/service/recharge/operators"
payload = ""
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic eGV0dGxlXzgzMjg2NjU5YmRmNzBkZWEzMDUwMzcwNzE1MTYwMzA0MDo3YzE1ZDQyYTZhYjEyOTYzYWI4NzJhMzFkOTk4MDk1ZDMwNTAzNzA3MTUxNjMyMDg5'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Response Examples
- Success
- Failed
{
code: "0x0200",
message: "Operator fetched successfully.",
status: "SUCCESS",
data: [
{
id: 1,
logo: "https://xyz.com/public/images/mobile_recharge_logo/airtel.png",
operatorName: "AIRTEL UP EAST",
operatorId: "AS"
},
{
id: 2,
logo: "https://xyz.com/public/images/mobile_recharge_logo/airtel.png",
operatorName: "AIRTEL",
operatorId: "AT"
},
{
id: 3,
logo: "https://xyz.com/public/images/mobile_recharge_logo/BSNL_TOPUP.png",
operatorName: "BSNL TOPUP",
operatorId: "BS"
},
{
id: 4,
logo: "https://xyz.com/public/images/mobile_recharge_logo/bsnl_validity.png",
operatorName: "BSNL VALIDITY",
operatorId: "BR"
}
]
}
{
"code": "0x0201",
"message": "Unauthorized IP used.",
"status": "FAILURE",
"ip": "152.58.32.60"
}
Response Codes
The API uses the following response codes to indicate the status of requests:
| Code | Description | Meaning |
|---|---|---|
0x0200 | SUCCESS | The request was processed successfully. |
0x0201 | UNAUTHORIZED | Authentication failed or insufficient permissions. |
0x0202 | FAILED | The request processing failed for a reason other than those specifically identified. |
0x0203 | MISSING_PARAMETER | The request is missing one or more required parameters. |
0x0206 | PENDING | The request has been received and is being processed, but processing has not yet completed. |
0x0205 | SOMETHING_WENT_WRONG | A server error occurred during processing of the request. |