Townships
GET Townships
Obtiene los municipios dependiendo de un pais y estado.
Resource URL
- GET https://api.next-cloud.mx/v1/catalogs/country/(string: country_id)/state/(int: state_id).(format)
- Parámetros:
format – json o xml.
country_id – Clave del pais
state_id – Identificador del estado
- Encabezados de solicitud:
Authorization – Token del usuario
- Objeto JSON de respuesta:
estado_id (string) – Clave del estado.
id (int) – Clave del pais.
delegacion (string) – Nombre del estado.
- Códigos de Status:
200 OK – Ningún error.
401 Unauthorized – Token no válido o no enviado.
404 Not Found – No existe el pais / No existe el estado / No existen municipios.
Example Request
GET v1/catalogs/country/mex/state/30.json HTTP/1.1
Host: api.next-cloud.mx
Accept: application/json
Authorization: Token ( token del usuario )
Example Response
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/json
Allow: GET, OPTIONS
[
{
"estado_id": 30,
"id": 1998,
"delegacion": "Acajete"
}, {
"estado_id": 30,
"id": 1999,
"delegacion": "Acatlán"
}, {
"estado_id": 30,
"id": 2000,
"delegacion": "Acayucan"
}
]
Example XML
Example request
GET v1/catalogs/country/mex/state/30.xml HTTP/1.1
Host: api.next-cloud.mx
Accept: application/xml
Authorization: Token ( token del usuario )
Example Response
HTTP/1.1 200 OK
Vary: Accept
Content-Type: application/xml; charset=utf-8
Allow: GET, OPTIONS
<?xml version="1.0" encoding="utf-8"?>
<root>
<list-item>
<estado_id>30</estado_id>
<id>1998</id>
<delegacion>Acajete</delegacion>
</list-item>
<list-item>
<estado_id>30</estado_id>
<id>1999</id>
<delegacion>Acatlán</delegacion>
</list-item>
<list-item>
<estado_id>30</estado_id>
<id>2000</id>
<delegacion>Acayucan</delegacion>
</list-item>
</root>v