Country
The country resource.
Basehttps://rest.carbon.ms/country
GET
/countryList countrys
Retrieve a paginated list of countrys. Filter, order, and select columns with PostgREST query parameters.
Query parameters
selectstringComma-separated columns to return. Defaults to all.
orderstringColumn to sort by, e.g. `createdAt.desc`.
limitintegerMaximum rows to return.
offsetintegerRows to skip, for pagination.
GEThttps://rest.carbon.ms/country
curl --request GET \
--url 'https://rest.carbon.ms/country?select=*&limit=10' \
--header 'Authorization: Bearer <api-key>'Response
[
{
"alpha2": "string",
"name": "Example",
"alpha3": "string"
}
]GET
/countryRetrieve a country
Fetch a single country by filtering on `alpha2`.
Query parameters
alpha2stringMatch on the country's `alpha2`, e.g. `eq.{id}`.
GEThttps://rest.carbon.ms/country
curl --request GET \
--url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'Response
{
"alpha2": "string",
"name": "Example",
"alpha3": "string"
}POST
/countryCreate a country
Create a new country.
Body parameters
namestringrequiredalpha3stringrequiredPOSThttps://rest.carbon.ms/country
curl --request POST \
--url https://rest.carbon.ms/country \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"name":"Example","alpha3":"string"}'Response
{
"alpha2": "string",
"name": "Example",
"alpha3": "string"
}PATCH
/countryUpdate a country
Update an existing country, matched on `alpha2`.
Body parameters
namestringrequiredalpha3stringrequiredPATCHhttps://rest.carbon.ms/country
curl --request PATCH \
--url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>' \
--header 'Content-Type: application/json' \
--header 'Prefer: return=representation' \
--data '{"name":"Example"}'Response
{
"alpha2": "string",
"name": "Example",
"alpha3": "string"
}DELETE
/countryDelete a country
Delete a country, matched on `alpha2`. Returns 204 No Content.
Query parameters
alpha2stringThe `alpha2` of the country to delete, e.g. `eq.{id}`.
DELETEhttps://rest.carbon.ms/country
curl --request DELETE \
--url 'https://rest.carbon.ms/country?alpha2=eq.%7Bid%7D' \
--header 'Authorization: Bearer <api-key>'204 No Content