Get Check API Status
This endpoint retrieves the current status of the Telegram service. It is useful for checking whether the service is operational before initiating message sending.
Configure the API Endpoint
https://api.betatel.com/api/v1/connect-hub/telegram/status
- Method:
GET
Set Up the Headers
| Param | Value | Description |
|---|---|---|
| Content-type | application/json | Specifies the payload format. |
Example Response
Status Code: 200 OK Content-Type: application/json
Example Response
{
"status": "Running",
"version": "2.1.0",
"uptime": "2d 0h 0m 5s"
}
| Field | Type | Description |
|---|---|---|
| status | string | The current status of the service (Running, Stopped, Maintenance). |
| version | string | The version of the service. |
| uptime | string | How long the service has been running (e.g., "2d 3h 45m 12s"). |
Code Snippets
- cUrl
- Python
- Node.js
- PHP
- Java
- C#
Example - cURL
curl --location 'https://api.betatel.com/api/v1/connect-hub/telegram/status' \
--header 'Content-Type: application/json'
Example - Python
import http.client
conn = http.client.HTTPSConnection("api.betatel.com")
headers = {
'Content-Type': 'application/json'
}
conn.request("GET", "/api/v1/connect-hub/telegram/status", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Example - Node.js
const axios = require('axios');
axios.get('https://api.betatel.com/api/v1/connect-hub/telegram/status', {
headers: {
'Content-Type': 'application/json'
}
})
.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://api.betatel.com/api/v1/connect-hub/telegram/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(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Example - Java
HttpResponse<String> response = Unirest.get("https://api.betatel.com/api/v1/connect-hub/telegram/status")
.header("Content-Type", "application/json")
.asString();
System.out.println(response.getBody());
Example - C#
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, "https://api.betatel.com/api/v1/connect-hub/telegram/status");
request.Headers.Add("Content-Type", "application/json");
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());