Health Check
curl --request GET \
--url https://api.oneclickdz.com/v3/ping \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/ping"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/ping', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.oneclickdz.com/v3/ping",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/ping"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.oneclickdz.com/v3/ping")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/ping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"api": "<string>",
"operators": {
"mobilis": "<string>",
"ooredoo": "<string>",
"djezzy": "<string>",
"mobilisFixedPlans": "<string>"
}
},
"meta": {
"timestamp": "<string>"
}
}Core
Health Check
Check API service health and operator availability
GET
/
v3
/
ping
Health Check
curl --request GET \
--url https://api.oneclickdz.com/v3/ping \
--header 'X-Access-Token: <api-key>'import requests
url = "https://api.oneclickdz.com/v3/ping"
headers = {"X-Access-Token": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Access-Token': '<api-key>'}};
fetch('https://api.oneclickdz.com/v3/ping', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.oneclickdz.com/v3/ping",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Access-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.oneclickdz.com/v3/ping"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Access-Token", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.oneclickdz.com/v3/ping")
.header("X-Access-Token", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.oneclickdz.com/v3/ping")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Access-Token"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"api": "<string>",
"operators": {
"mobilis": "<string>",
"ooredoo": "<string>",
"djezzy": "<string>",
"mobilisFixedPlans": "<string>"
}
},
"meta": {
"timestamp": "<string>"
}
}Overview
The health check endpoint allows you to verify the API service status and check the availability of each mobile operator.Response
Example Request
curl --request GET \
--url https://api.oneclickdz.com/v3/ping
curl --request GET \
--url https://api.oneclickdz.com/v3/ping \
--header 'X-Access-Token: your_api_key_here'
const response = await fetch("https://api.oneclickdz.com/v3/ping");
const data = await response.json();
console.log("API Status:", data.data.api);
console.log("Operators:", data.data.operators);
const response = await fetch("https://api.oneclickdz.com/v3/ping", {
headers: {
'X-Access-Token': 'your_api_key_here'
}
});
const data = await response.json();
console.log("API Status:", data.data.api);
console.log("Operators:", data.data.operators);
import requests
response = requests.get('https://api.oneclickdz.com/v3/ping')
data = response.json()
print
{
"success": true,
"data": {
"api": "ok",
"operators": {
"mobilis": "up",
"ooredoo": "up",
"djezzy": "up",
"mobilisFixedPlans": "up"
}
},
"meta": {
"timestamp": "2025-10-29T00:35:58.557Z"
}
}
Use Cases
Service Monitoring
Monitor API availability and operator status for uptime tracking
Pre-flight Checks
Verify service is operational before processing transactions
Operator Filtering
Hide unavailable operators from your UI
Health Dashboard
Build a status dashboard for your operations team
Integration Example
// Check service health before processing orders
async function canProcessOrders() {
try {
const response = await fetch("https://api.oneclickdz.com/v3/ping");
const data = await response.json();
if (data.data.api !== "ok") {
console.error("API service is down");
return false;
}
return true;
} catch (error) {
console.error("Health check failed:", error);
return false;
}
}
// Check specific operator availability
async function isOperatorAvailable(operator) {
const response = await fetch("https://api.oneclickdz.com/v3/ping");
const data = await response.json();
const operatorMap = {
Mobilis: "mobilis",
Ooredoo: "ooredoo",
Djezzy: "djezzy",
Pixx: "mobilisFixedPlans",
};
const operatorKey = operatorMap[operator];
return data.data.operators[operatorKey] === "up";
}
Best Practices
Poll Periodically
Poll Periodically
Check the health endpoint every 30-60 seconds to maintain an up-to-date view of service status.
setInterval(async () => {
const response = await fetch('https://api.oneclickdz.com/v3/ping');
const data = await response.json();
updateServiceStatus(data.data);
}, 30000); // Check every 30 seconds
Cache Status
Cache Status
Cache the status for 30-60 seconds to avoid excessive requests
let cachedStatus = null;
let lastCheck = 0;
async function getServiceStatus() {
const now = Date.now();
if (cachedStatus && (now - lastCheck) < 30000) {
return cachedStatus;
}
const response = await fetch('https://api.oneclickdz.com/v3/ping');
cachedStatus = await response.json();
lastCheck = now;
return cachedStatus;
}
Handle Degraded State
Handle Degraded State
When an operator is down, inform users and suggest alternatives
if (data.data.operators.djezzy === 'down') {
showNotification('Djezzy service temporarily unavailable. Try Mobilis or Ooredoo.');
}

