Get States/Provinces

Description

This service returns a list of all available states or provinces for a specific country.


Request

Endpoint

GET https://<server-url>/api/v4/referencedata/countries/{countryId}/states

Path Parameters

Parameter
Type
Description

countryId

Integer

The unique identifier of the country for which to retrieve the states/provinces. To get this identifier, please see the Get Countries method.

Parameters

Parameter
Location
Description

touchpoint

Query / Header

The identifier for the touchpoint making the request. If sent as a header, the name must be Thalamus-Touchpoint.

token

Query / Header

The authentication token for the API. If sent as a header, the name must be Thalamus-Token.

activity

Query / Header

Optional. The activity to be used. If sent as a header, the name must be Thalamus-Activity.

Content-Type

Header

Specifies the content type of the request body. Must be application/json.

Full URL Example

https://<server-url>/api/v4/referencedata/countries/1/states?touchpoint=test&token=testtesttesttesttesttesttesttesttesttesttesttesttesttesttesttest

Request Body

This request does not have a body.


Response

✅ Successful Response: 200 OK

A JSON array of state/province objects is returned for the specified country.

Field
Type
Description

name

String

The name of the state or province.

id

Number

The unique identifier for the state or province.

countryId

Number

The identifier of the parent country.

JSON

[
  {
    "name": "Buenos Aires",
    "id": 1,
    "countryId": 1
  },
  {
    "name": "Buenos Aires Capital",
    "id": 2,
    "countryId": 1
  },
  {
    "name": "Catamarca",
    "id": 3,
    "countryId": 1
  }
]

Last updated

Was this helpful?