Country Endpoints
In the context of our API, a country represents an entity.
Common Country Characteristics
-
Unique Identification: Each country has a unique identifier
idthat distinguishes them from other countries in the system. -
Country Data: For each country, a description and ISO code are stored.
Endpoints
GET/Country/getCountry
Retrieve all Countries stored in the system.
Description
This endpoint retrieves a paginated list of countries from the system. It allows clients to fetch country data based on pagination parameters such as page number (page) and items per page (pageSize). The response includes detailed information about each country, including its ID, description, and country (iso) code.
Parameters
| Name | Description | Type | Default Value |
|---|---|---|---|
page | Page number | Integer | 1 |
pageSize | Number of items per page | Integer | 10 |
Responses
JSON
{
"data": [
{
"id": "string",
"idRemote": "string",
"description": "string",
"iso": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
<iso>string</iso>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
GET/Country/getCountryByIso/{iso}
Obtaining a stored Country given its ISO code.
Description
This endpoint retrieves all data for a country given its iso code. The response includes detailed information about each country, including its ID, description, and country code (iso).
Parameters
| Name | Description | Type |
|---|---|---|
iso | ISO Code | String required |
Responses
JSON
{
"data": [
{
"id": "string",
"idRemote": "string",
"description": "string",
"iso": "string"
}
],
"pagination": {
"totalItems": 0,
"itemsPerPage": 0,
"currentPage": 0,
"totalPages": 0,
"nextPageUrl": "string"
}
}
XML
<?xml version="1.0" encoding="UTF-8"?>
<export>
<data>
<item>
<id>string</id>
<idRemote>string</idRemote>
<description>string</description>
<iso>string</iso>
</item>
</data>
<pagination>
<totalItems>0</totalItems>
<itemsPerPage>0</itemsPerPage>
<currentPage>0</currentPage>
<totalPages>0</totalPages>
<nextPageUrl>string</nextPageUrl>
</pagination>
</export>
Possible Response Errors
| Error | Response Status | Response Body |
|---|---|---|
| This error occurs when the database name is not registered. It indicates an internal server problem. | 500 | {"code": 500,"error": "This dbs name is not register"} |
| This error occurs when the system cannot insert or update records in the test database. | 500 | {"code": 500,"error": "Invalid connection name, you cannot insert in default"} |
| This error indicates that the server rejects the request. | 400 | {"code": 400,"error": "Bad Request"} |
| This error occurs when you are not authorized. | 401 | {"code": 401,"error": "Unauthorized."} |
| This error occurs when the Country could not be found. | 404 | {"code": 404,"error": "No entity found for Country."} |
| This error occurs when you try to send too many requests in a short period of time. | 429 | {"code": 429,"error": "Too Many Requests"} |