Skip to main content

GET Get Countries

This endpoint returns a paginated list of all available countries for eSIM services.

Configure the API Endpoint

https://esim.betatel.com/api/v1/esim/countries
  • Method: GET

Set Up the Headers

ParamValueDescription
Content-Typeapplication/jsonSpecifies the payload format.
x-api-key{{x-api-key}}Your unique API key for secure access.
x-user-id{{x-user-id}}Your user identifier for added security and tracking.

Query Parameters

Info: Pagination options assist in navigating the array of countries available for eSIM services, crucial for managing global operations.

ParamTypeRequiredDefaultDescription
offsetintegeroptional0Pagination offset
countintegeroptional20Number of items to return

Example Response

Status Code: 200 OK
Content-Type: application/json

Example Response
{
"total": 195,
"offset": 0,
"count": 20,
"countries": [
{
"id": "US",
"name": "United States",
"iso_code": "US",
"country_code": "+1"
}
]
}

The response includes the total number of countries available, current pagination offset, number of items returned, and an array of country objects.

FieldTypeDescription
totalintegerTotal number of countries available
offsetintegerCurrent pagination offset
countintegerNumber of items returned
countriesarrayArray of country objects

Country Object

FieldTypeDescription
idstringCountry identifier
namestringCountry name
iso_codestringISO country code
country_codestringInternational dialing code

Code Snippets

Note: Adapt the code snippets to fetch and display a list of countries supported, enhancing your system's geographic capabilities.

Example - cURL
    curl --location 'https://esim.betatel.com/api/v1/esim/countries?offset=0&count=20' \
--header 'Accept: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--header 'x-user-id: {{x-user-id}}'

Error Handling

Important: Improper query parameters can result in '400' status codes. Verify input carefully.

  • 400 - Bad Request - Invalid parameters
  • 401 - Unauthorized - Invalid or missing API key