GET Get Inventories
Info: Retrieve a complete list of inventories to keep track of available resources. Use offsets for large datasets.
This endpoint returns a paginated list of all eSIM inventories available to the authenticated user.
Configure the API Endpoint
https://esim.betatel.com/api/v1/esim/inventories
- 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. |
Query Parameters
Tip: Employ 'offset' and 'count' parameters wisely for smooth pagination when handling extensive inventories.
| Param | Type | Required | Default | Description |
|---|---|---|---|---|
| offset | integer | optional | 0 | Pagination offset |
| count | integer | optional | 20 | Number of items to return |
Example Response
Status Code: 200 OK
Content-Type: application/json
{
"total": 1,
"offset": 0,
"count": 1,
"inventories": [
{
"id": 51952,
"name": "Betatel LTD Inventory 1",
"created_date": 1761330317000,
"modified_date": 1761330317000,
"company": 72571,
"parent_inventory": 1,
"status": "Active",
"wallet": 99612820,
"whitelist": 11599
}
]
}
The response includes the total number of inventories, current pagination offset, number of items returned, and an array of inventory objects with detailed information.
Inventory Object
| Field | Type | Description |
|---|---|---|
| id | integer | Inventory identifier |
| name | string | Inventory name |
| created_date | integer | Creation date in milliseconds |
| modified_date | integer | Modification date in milliseconds |
| company | integer | Company identifier |
| parent_inventory | integer | Identifier for parent inventory |
| status | string | Inventory status |
| wallet | integer | Wallet identifier |
| whitelist | integer | Whitelist identifier |
Code Snippets
Warning: Double-check header information, as correct keys are vital to access the full spectrum of inventory data.
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
curl --location 'https://esim.betatel.com/api/v1/esim/inventories?offset=0&count=20' \
--header 'Accept: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--header 'x-user-id: {{x-user-id}}'
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/inventories?offset=0&count=20", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const axios = require('axios');
axios.get('https://esim.betatel.com/api/v1/esim/inventories', {
params: {
offset: 0,
count: 20
},
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);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://esim.betatel.com/api/v1/esim/inventories?offset=0&count=20',
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;
HttpResponse<String> response = Unirest.get("https://esim.betatel.com/api/v1/esim/inventories?offset=0&count=20")
.header("Accept", "application/json")
.header("x-api-key", "{{x-api-key}}")
.header("x-user-id", "{{x-user-id}}")
.asString();
System.out.println(response.getBody());
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://esim.betatel.com/api/v1/esim/inventories?offset=0&count=20");
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
Important: Invalid parameters will result in a '400' error. Ensure that API keys are correct to authenticate requests.
- 400 - Bad Request - Invalid parameters
- 401 - Unauthorized - Invalid or missing API key