Skip to main content

System API

System API Overview

The System API provides essential methods to access information about the overall status and health of the eSIM service. It is a vital tool for monitoring and integrating various operational insights into your applications.

getStatus

The getStatus method returns the current status of the eSIM API service, including version information and health check. It's useful for ensuring that the service is operational before making other API calls or integrating with live environments.

Usage

getStatus is a simple method that requires no parameters and doesn’t need authorization, making it a quick and easy way to verify the API's status.

Example Code

Here's how to use the System API to check the status:

import { SystemApi, Configuration } from '@betatelltd/esim-sdk';

const config = new Configuration({
apiKey: (name: string) => {
if (name === 'x-api-key') return 'your-api-key';
if (name === 'x-user-id') return 'your-user-id';
return '';
},
basePath: 'base-url',
});
const apiInstance = new SystemApi(configuration);

async function checkApiStatus() {
const { status, data } = await apiInstance.getStatus();
console.log(`API Status: ${data.status}, Version: ${data.version}`);
}

checkApiStatus();

Response Codes

  • 200: API is operational. This means that all services are functioning as expected.
  • 503: Service Unavailable - The API is currently down for maintenance or facing issues that prevent it from functioning normally.

Additional Information

  • Reliability: Regularly checking the API status helps ensure continuity of service and allows for proactive measures in case of outages.
  • Integration: This API can be integrated into dashboards or monitoring tools to provide real-time status updates.

StatusResponse

The StatusResponse object provides key details about the API's current state. Here are its properties:

NameTypeDescriptionNotes
statusstringCurrent status of the API[default to undefined]
versionstringAPI version[default to undefined]
uptimenumberService uptime in seconds[optional] [default to undefined]

Example

import { StatusResponse } from '@betatelltd/esim-sdk';

const instance: StatusResponse = {
status: 'operational',
version: '1.0.0',
uptime: 3600,
};