GetDistrictList

Post  https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList


The GetDistrictList API retrieves the list of districts for a given state. It is used to populate district-level data such as in address forms, user registration, or service availability checks.

Body Parameters
{
  "RegistrationID": "AOP-554",
  "StateCode": "24"
} 
Request Parameters
Name Type Description
RegistrationID String Unique registration identifier, often tied to the user.
StateCode String The state code in India (usually 2-letter codes as per ISO or internal system).
Responses

200

200

Response

200

RESPONSE BODY

Json

401

401

Response

401

RESPONSE BODY

Object

status     boolean

response_code     integer

message     string


Did this page help you?     Yes    No

Language
shell Shell
python Python
node Node
c# C#
php PHP

cURL

curl --location 'https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList' \
--header 'Content-Type: application/json' \
--data  '{
"RegistrationID": "AOP-554",
"StateCode": "24"
}'
                                
import requests
import json

url = 'https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList'
payload = json.dumps({
"RegistrationID": "AOP-554",
"StateCode": "24"
}) 

headers = {
  "Content-type" : "application/json"
}

response = requests.request("POST" url, headers=headers, data=payload)

print (response.text)
                                
var requests = require("request");
var options = { 
  "method" : "POST",
  "url" : 'https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList',
  "headers" : {
    "Content-Type" : 'application/json'
  },
  body: JSON.stringify({
  "RegistrationID": "AOP-554",
  "StateCode": "24" }) 
}; 
request(options, function(error, response){
   if(error) throw new Error(error);
   console.log(response.body); 
}); 
                                
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post,'https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList')
var content = new StringContent(
  "{
  "RegistrationID": "AOP-554",
  "StateCode": "24"
}",
  null,"application/json"
); 

request.Content = content;
var response =  await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
                                
<?php
$curl =  curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL =>  'https://api.aopay.co.in/api/AOP/V1/AEPS/GetDistrictList',
  CURLOPT_RETURNTRANSFER =>  true,
  CURLOPT_ENCODING =>  '',
  CURLOPT_MAXREDIRS =>  10,
  CURLOPT_TIMEOUT =>  0,
  CURLOPT_FOLLOWLOCATION =>  true,
  CURLOPT_HTTP_VERSION =>  CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =>  'POST',
  CURLOPT_POSTFIELDS =>  '{
  "RegistrationID": "AOP-554",
  "StateCode": "24"
  }',
  CURLOPT_HTTPHEADER =>  array(
    'Content-Type: application/json'
  ),
));
$response =  curl_exec($curl);
curl_close($curl);
echo $response;
                                

RESPONSE

200

401

-Result

Example

{
    "status": true,
    "msg": "District List Fetched Successfully",
         "data": [
                {
                "district_code": 384,
                "name": "East",
                "state_code": 24
               },
               {
                         "district_code": 385,
                        "name": "New Delhi",
                        "state_code": 24
              }
              ],
              "statusCode": 200,
              "Status": "True",
              "message": "District List Fathched Successfuly.",
              "Value": ""
}
                                
{
  "status": false,
  "response_code": 5,
  "message": "Invalid signature encoding"
}