GET Check API Status
This endpoint retrieves the status of the eSIM service. It is useful for checking whether the service or application is operational.
Configure the API Endpoint
https://esim.betatel.com/api/v1/esim/status
- Method:
GET
Set Up the Headers
| Param | Value | Description |
|---|---|---|
| Content-Type | application/json | Specifies 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. |
Example Response
Status Code: 200 OK
Content-Type: application/json
Example Response
{
"status": "Running",
"version": "1.0.0",
"uptime": "2d 0h 0m 5s"
}
The response will include the status, version, and uptime of the service. The body of the response will contain the following parameters:
| Field | Type | Description |
|---|---|---|
| status | string | The current status of the service |
| version | string | The version of the service |
| uptime | string | The uptime of the service |
Code Snippets
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
Example - cURL
curl --location 'https://esim.betatel.com/api/v1/esim/status' \
--header 'Accept: application/json' \
--header 'x-api-key: `{{x-api-key}}`' \
--header 'x-user-id: {{x-user-id}}'
Example - Python
import http.client
conn = http.client.HTTPSConnection("esim.betatel.com")
headers = {
'Accept': 'application/json',
'x-api-key': '{{x-api-key}}',
'x-user-id': '{{x-user-id}}'
}
conn.request("GET", "/api/v1/esim/status", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Example - Node.js
const axios = require('axios');
axios.get('https://esim.betatel.com/api/v1/esim/status', {
headers: {
'Accept': 'application/json',
'x-api-key': '{{x-api-key}}',
'x-user-id': '{{x-user-id}}'
}
})
.then((response) => {
console.log(response.data);
})
.catch((error) => {
console.log(error);
});
Example - PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://esim.betatel.com/api/v1/esim/status',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Accept: application/json',
'x-api-key: {{x-api-key}}',
'x-user-id: {{x-user-id}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example - Java
HttpResponse<String> response = Unirest.get("https://esim.betatel.com/api/v1/esim/status")
.header("Accept", "application/json")
.header("x-api-key", "{{x-api-key}}")
.header("x-user-id", "{{x-user-id}}")
.asString();
System.out.println(response.getBody());
Example - C#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://esim.betatel.com/api/v1/esim/status");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("x-api-key", "{{x-api-key}}");
request.Headers.Add("x-user-id", "{{x-user-id}}");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Error Handling
- 400 - Bad Request - Invalid parameters
- 401 - Unauthorized - Invalid or missing API key