Townships

GET Townships

Obtiene los municipios dependiendo de un pais y estado.

Resource URL

GET http://api.next-cloud.mx/v1/catalogs/country/(string: country_id)/state/(int: state_id).(format)
Parameters:
  • format – json o xml.
  • country_id – Clave del pais
  • state_id – Identificador del estado
Request Headers:
 
Response JSON Object:
 
  • estado_id (string) – Clave del estado.
  • id (int) – Clave del pais.
  • delegacion (string) – Nombre del estado.
Status Codes:

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