OLT, Concentrator and WhatsApp

Reference for the olt, concentradora and whatsapp areas of the public API: querying OLTs and ONTs, remote provisioning (Nokia), PPPoE sessions of the concentrators and sending messages through the WhatsApp number paired in Ravi.

OLT API

The action=olt area queries the monitored OLTs and their ONTs and, on Nokia OLTs, also provisions and removes ONTs remotely. It requires an API key with the OLTs Access permission checked; without it, the gateway responds HTTP 403. Authentication and the base URL are the same as for the whole API (see Authentication):

base URL
GET|POST  https://YOUR-SERVER/api/api.php?token=KEY&action=olt&operation=OPERATION&...

How the data is obtained

  • Read operations (search_olt, search_ont, status_summary) return the snapshot of the OLT's last synchronization, run according to the schedule configured on the OLT screen (from 5 minutes up to 6 hours). The sync_date field indicates when the data was collected. It is not a live query to the equipment.
  • Write operations (activation, exclusion, unprovisioned, search_position) actually connect to the OLT over SSH or Telnet, using the registered credentials (the OLT's own or inherited from the system default). Today they are available only for Nokia OLTs: on any other brand the response is {"msg":"Service not available for this OLT model"}. For the other brands, use the OLT screen.
  • In every call, the OLT can be identified by olt (numeric ID) or name (exact registered name). In the provisioning operations, use olt (ID).

In this module, operation errors arrive with HTTP 200 and the body {"msg":"..."}. Treat only the responses expected from each operation as success; any other message in msg is an error. Only the gateway uses HTTP codes (400/401/403).

Calculated ONT status

The health summary classifies each ONT based on the signal threshold configured on the OLT:

StatusMeaning
onlineActive ONT with signal within the expected range.
signal-alertSignal approaching the OLT's alert threshold.
low-signalSignal below the configured threshold.
offlineONT disconnected.
breakFiber break detected.
no-dataNo reading data for the ONT.

Query operations

GET /api/api.php?action=olt&operation=search_olt

Lists the registered OLTs, with the option to include all ONTs of each one.

ParameterTypeRequiredDescription
oltintNoOLT ID. Without olt and name, returns all.
namestringNoExact OLT name (alternative to the ID).
include_ontsboolNotrue includes the onts array with all ONTs from the last synchronization (default: false).

Each OLT carries id, name, execution_cronogram, ip, brand (V-Solution, Huawei, Fiberhome, ZTE, Ubiquiti, PARKS, NOKIA, Phyhome, C-DATA, Intelbras, Digistar, DATACOM, Cianet) and sync_date. Each ONT carries, among others: slot, pon, ont, interface, nome, desc, mac, ns (serial), rxpower, txpower, oltrx, voltagem, temperatura, distancia, biascurrent, dataconn (last connection date: for an active ONT, when it came up; for an offline ONT, when it went down; empty when there is no record), reason (drop reason), data (date and time that ONT was read in the last synchronization) and status (raw ONT status code: 0 = fiber break, 1 = active ONT, 2 and 4 = offline). The calculated status used in status_summary derives from this code combined with the signal level (rxpower) against the threshold configured on the OLT. Each ONT also carries the connection history fields last_up, last_down, last_seen_online, offline_since and tracked_since, described under ONT connection history.

curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=search_olt&olt=3&include_onts=true"
response
{
  "olts": [
    {
      "id": 3,
      "name": "OLT-CENTRO",
      "execution_cronogram": "Run every 5 minutes",
      "ip": "10.0.0.10",
      "brand": "NOKIA",
      "sync_date": "2026-07-03 10:05:02",
      "onts": [
        { "slot": "1", "pon": "2", "ont": "14", "nome": "cliente-joao", "ns": "ALCL:F0AB12CD",
          "rxpower": "-19.8", "txpower": "2.1", "status": "1", "mac": "AA:BB:CC:DD:EE:FF" }
      ]
    }
  ]
}

Errors: No OLTs found, OLT not found.

GET /api/api.php?action=olt&operation=search_ont

Searches ONTs of an OLT by MAC, serial or physical position. Useful to locate the customer from the data the management system has at hand.

ParameterTypeRequiredDescription
olt or nameint / stringYesTarget OLT (ID or exact name).
macstringOne of the threeONT MAC.
nsstringOne of the threeONT serial.
slotintOne of the threeONT slot; can be combined with pon and ont to narrow down.
ponintNoPON, used together with slot.
ontintNoONT position, used together with slot and pon.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=search_ont&olt=3&ns=ALCL:F0AB12CD"
response
{
  "onts": [
    { "slot": "1", "pon": "2", "ont": "14", "name": "cliente-joao", "description": "Rua A, 123",
      "rx_ont": "-19.8", "tx_ont": "2.1", "rx_olt": "-21.4", "voltage": "3.2", "temperature": "45",
      "distance": "1830", "biascurrent": "9", "status": "1", "sync_date": "2026-07-03 10:05:02", "reason": "",
      "last_up": "2026-07-01 08:12:40", "last_down": "2026-07-01 08:10:05", "last_seen_online": "2026-07-03 10:05:02",
      "offline_since": "", "tracked_since": "2026-06-20 09:00:01" }
  ]
}

Errors: At least one parameter must be provided: 'mac', 'ns', or 'slot', OLT ID or name is required, OLT not found, ONT not found.

ONT connection history

Besides the snapshot of the last synchronization, each ONT (in search_ont and in search_olt with include_onts=true) carries five date fields, formatted YYYY-MM-DD HH:MM:SS, empty when there is no record. They support management system routines such as "deauthorize ONTs offline for more than 60 days".

FieldMeaning
last_upLast time the ONT became active, as recorded by the OLT.
last_downLast time the ONT went down, as recorded by the OLT.
last_seen_onlineLast synchronization in which the system saw the ONT active.
offline_sinceOffline ONTs only: since when it has been down. It is the most recent of the drop recorded by the OLT and the last time the system saw it active. Empty for active ONTs and when there is no record at all.
tracked_sinceSince when the system has been tracking this ONT on this OLT.

The OLT only keeps the drop date of ONTs that went down while it was running. An ONT that has never been active since the OLT's last reboot has neither last_up nor last_down, and the system has no way of knowing when it dropped either: in that case offline_since comes empty. For a rule based on days offline, treat an empty offline_since with a tracked_since older than the deadline as "offline for at least that long", since the ONT was already down when tracking started. Today last_up and last_down come from the OLT on Huawei equipment; on other brands, the history fields rely on what the system observed between synchronizations.

GET /api/api.php?action=olt&operation=status_summary

OLT health summary: total ONTs and count by calculated status (table above).

ParameterTypeRequiredDescription
olt or nameint / stringYesTarget OLT (ID or exact name).
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=status_summary&olt=3"
response
{
  "total_onts": 412,
  "status_counts": {
    "online": 396, "signal-alert": 6, "low-signal": 4,
    "offline": 4, "break": 1, "no-data": 1
  }
}

Errors: OLT ID or name is required, OLT not found.

Provisioning operations (Nokia only)

GET /api/api.php?action=olt&operation=unprovisioned

Queries the OLT live, updates the system's list of pending ONTs and returns the ONTs awaiting authorization. First step of the provisioning flow.

ParameterTypeRequiredDescription
oltintYesNokia OLT ID.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=unprovisioned&olt=3"
response
{
  "msg": "Search completed successfully",
  "ONTs": [
    { "pon": "2", "slot": "1", "serial": "ALCL:F0AB99EE" }
  ]
}

Errors: OLT ID is required, OLT not found, Service not available for this OLT model (brand other than Nokia) or msg containing Error connecting. IP: ... (connection failure to the OLT).

GET /api/api.php?action=olt&operation=search_position

Returns the next free position on a PON. Use it to find the ont value before calling activation.

ParameterTypeRequiredDescription
oltintYesNokia OLT ID.
slotintYesPON slot.
ponintYesPON number.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=search_position&olt=3&slot=1&pon=2"
response
{ "msg": "Search completed successfully", "position": 15 }

Errors: Missing required parameter: slot, Missing required parameter: pon, OLT ID is required, OLT not found, Service not available for this OLT model (brand other than Nokia) or msg containing Error connecting. IP: ... (connection failure to the OLT).

POST /api/api.php?action=olt&operation=activation

Authorizes (activates) an ONT on the Nokia OLT, running the chosen authorization model, and already registers the ONT in monitoring, removing it from the pending list.

ParameterTypeRequiredDescription
oltintYesNokia OLT ID.
serial_numberstringYesONT serial. Without :, the separator is inserted automatically after the 4th character (Nokia standard ALCL:XXXX...).
model_idintYesID of the ONU authorization model registered in the system catalog.
slotintYesPON slot.
ponintYesPON number.
ontintYesONT position (obtained from search_position).
vlanintYesService VLAN.
descriptionstringYesONT description (e.g. customer name or code).
curl
curl -s -X POST "https://ravi.yourprovider.com/api/api.php" \
  -d "token=KEY" -d "action=olt" -d "operation=activation" \
  -d "olt=3" -d "serial_number=ALCLF0AB99EE" -d "model_id=2" \
  -d "slot=1" -d "pon=2" -d "ont=15" -d "vlan=100" \
  -d "description=cliente-maria"
response
{ "msg": "ONT activated successfully" }

Errors: Missing required parameter: X, OLT ID is required, OLT not found, Model id N not found, Service not available for this OLT model (brand other than Nokia) or msg containing Error connecting. IP: ... (SSH failure: check credentials and port on the OLT screen).

DEL /api/api.php?action=olt&operation=exclusion

Removes the ONT from the Nokia OLT and from Ravicor.

The removal is applied on the equipment immediately and drops the subscriber service at that position. Confirm slot, PON and position before calling; there is no undo through the API.

ParameterTypeRequiredDescription
oltintYesNokia OLT ID.
slotintYesPON slot.
ponintYesPON number.
ontintYesPosition of the ONT to remove.
curl
curl -s -X POST "https://ravi.yourprovider.com/api/api.php" \
  -d "token=KEY" -d "action=olt" -d "operation=exclusion" \
  -d "olt=3" -d "slot=1" -d "pon=2" -d "ont=15"
response
{ "msg": "ONT removed successfully", "log": "..." }

The log field carries the session output on the equipment, useful for auditing. The errors are the same as activation.

Recommended provisioning flow (Nokia)

  1. Call unprovisioned and note the serial, slot and pon of the new ONT.
  2. Call search_position with that slot and pon to get the free position.
  3. Call activation with the model_id of the desired profile, the vlan and the customer's description.
  4. After the OLT's next synchronization, confirm with search_ont (searching by the serial in ns).

Full activation example in the three languages:

# 1) pending  2) free position  3) activation
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=unprovisioned&olt=3"
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=olt&operation=search_position&olt=3&slot=1&pon=2"
curl -s -X POST "https://ravi.yourprovider.com/api/api.php" \
  -d "token=KEY" -d "action=olt" -d "operation=activation" \
  -d "olt=3" -d "serial_number=ALCL:F0AB99EE" -d "model_id=2" \
  -d "slot=1" -d "pon=2" -d "ont=15" -d "vlan=100" -d "description=cliente-maria"
<?php
$base  = 'https://ravi.yourprovider.com/api/api.php';
$token = 'KEY';

function ravi(array $params) {
    global $base, $token;
    $ch = curl_init($base);
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => http_build_query(['token' => $token] + $params),
        CURLOPT_RETURNTRANSFER => true,
    ]);
    $out = json_decode(curl_exec($ch), true);
    curl_close($ch);
    return $out;
}

$pend = ravi(['action' => 'olt', 'operation' => 'unprovisioned', 'olt' => 3]);
$ont  = $pend['ONTs'][0];

$pos = ravi(['action' => 'olt', 'operation' => 'search_position',
             'olt' => 3, 'slot' => $ont['slot'], 'pon' => $ont['pon']]);

$res = ravi(['action' => 'olt', 'operation' => 'activation', 'olt' => 3,
             'serial_number' => $ont['serial'], 'model_id' => 2,
             'slot' => $ont['slot'], 'pon' => $ont['pon'], 'ont' => $pos['position'],
             'vlan' => 100, 'description' => 'cliente-maria']);

if (($res['msg'] ?? '') !== 'ONT activated successfully') {
    throw new RuntimeException('Activation failed: ' . ($res['msg'] ?? '?'));
}
import requests

BASE  = "https://ravi.yourprovider.com/api/api.php"
TOKEN = "KEY"

def ravi(**params):
    r = requests.post(BASE, data={"token": TOKEN, **params}, timeout=60)
    return r.json()

pend = ravi(action="olt", operation="unprovisioned", olt=3)
ont  = pend["ONTs"][0]

pos = ravi(action="olt", operation="search_position",
           olt=3, slot=ont["slot"], pon=ont["pon"])

res = ravi(action="olt", operation="activation", olt=3,
           serial_number=ont["serial"], model_id=2,
           slot=ont["slot"], pon=ont["pon"], ont=pos["position"],
           vlan=100, description="cliente-maria")

if res.get("msg") != "ONT activated successfully":
    raise RuntimeError(f"Activation failed: {res.get('msg')}")

ONT activations and removals done through the API are recorded in the system Action history, which makes it easy to audit what each integration executed.


Concentrator API

The action=concentradora area is read-only: it lists active PPPoE concentrators, details configuration, queries sessions (online and offline users), connection history per user and general statistics. It requires an API key with the Concentrators Access permission checked.

The data comes from the concentrator's last synchronization (same reasoning as the OLT): the ultima_sincronizacao field indicates when the snapshot was taken. Only registered and enabled concentrators appear in the responses.

Unlike the OLT, DNS and WhatsApp modules, this module uses real HTTP codes and its own envelope: success comes as {"success":true,"data":...} and error as {"success":false,"error":"..."} with HTTP 400 or 404. Internal failures (for example, an unavailable database) respond with HTTP 500 and the same {"success":false,"error":"..."} envelope. The error messages come out in the language configured in the system.

Concentrator status

statusstatus_descricao
1Critical
2Normal
3Warning
4Maintenance
5Unknown
6OK

For PPPoE users, the status is always online or offline.

Operations

GET /api/api.php?action=concentradora&operation=list

Lists all active concentrators. No extra parameters.

Fields per concentrator: id, nome, ip, marca, tipo, status, status_descricao, ultima_sincronizacao, tempo_sincronizacao, alerta_pppoe_ativo, ping_ativo, dias_offline, cron_ativo, dados_historicos_ativo, alerta_linkdown_ativo, usuarios_online, total_usuarios.

curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=list"
response
{
  "success": true,
  "data": [
    { "id": 1, "nome": "BNG-01", "ip": "10.0.0.1", "marca": "Mikrotik", "tipo": "PPPoE",
      "status": 2, "status_descricao": "Normal", "ultima_sincronizacao": "2026-07-03 10:04:00",
      "usuarios_online": 388, "total_usuarios": 512 }
  ]
}
GET /api/api.php?action=concentradora&operation=get

Details a concentrator: everything from list plus the SNMP configuration (herdar_pai, snmp, versao_snmp, porta_snmp), tamanho_pacotes, quantidade_pacotes and historico_trafego_ativo. The detail also includes the ativo field (always true, since only enabled concentrators are returned by the API).

ParameterTypeRequiredDescription
idintYesConcentrator ID.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=get&id=1"

Errors: Concentrator ID not provided (HTTP 400), Concentrator not found (HTTP 404).

GET /api/api.php?action=concentradora&operation=get_users

Returns the concentrator's PPPoE sessions, with optional filtering by status.

ParameterTypeRequiredDescription
idintYesConcentrator ID.
statusstringNoonline, offline or all (default: all).

Per user: username, ip, vlan, status, data_desconexao (offline only), download_bytes, upload_bytes, ping_ms, jitter_ms, packet_loss.

The ping_ms, jitter_ms and packet_loss fields are returned as text (e.g. "15.2") or null when there is no measurement, a common case for offline users. The tempo_sincronizacao field is also text (e.g. "0.523"). download_bytes and upload_bytes are numeric.

curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=get_users&id=1&status=online"
response
{
  "success": true,
  "data": [
    { "username": "joao.silva", "ip": "100.64.1.23", "vlan": "110", "status": "online",
      "download_bytes": 5382190342, "upload_bytes": 812009344,
      "ping_ms": "8.2", "jitter_ms": "1.1", "packet_loss": "0" }
  ]
}

If the concentrator has never synchronized, the response is success with an empty data.

GET /api/api.php?action=concentradora&operation=get_user_details

Details a specific PPPoE user: everything from get_users plus concentradora_id, concentradora_nome, linkdown_count (number of recorded sessions, that is, reconnections) and historico_ping, which currently always returns an empty list.

ParameterTypeRequiredDescription
usernamestringYesUser's PPPoE login.
concentradora_idintYesConcentrator ID.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=get_user_details&username=joao.silva&concentradora_id=1"

Errors: Username and concentradora_id are required (400), Concentrator not found (404), Concentrator data not found (no synchronization), User not found (404).

GET /api/api.php?action=concentradora&operation=get_user_history

User session history, from the most recent to the oldest: data_conexao, data_desconexao, duracao (text "N days, HH:MM:SS"), duracao_segundos, ip, vlan, download_bytes, upload_bytes.

ParameterTypeRequiredDescription
usernamestringYesUser's PPPoE login.
concentradora_idintYesConcentrator ID.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=get_user_history&username=joao.silva&concentradora_id=1"

The download_bytes and upload_bytes fields are accumulated in bytes (not bits) per session. To estimate a transfer rate, compare two readings and divide the difference by the interval between synchronizations.

GET /api/api.php?action=concentradora&operation=get_user_traffic

Kept only for compatibility: it always returns an empty data with the message "Granular traffic data not available. Use get_user_history to obtain traffic per session.". Use get_user_history to obtain traffic per session.

Even though it is compatibility-only, the operation still requires username and concentradora_id; without them it responds HTTP 400 with the error Username and concentradora_id are required.

GET /api/api.php?action=concentradora&operation=search

Searches concentrators by name or IP (partial search).

ParameterTypeRequiredDescription
querystringYesPart of the name or the IP.
curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=search&query=BNG"

Each result brings a reduced set compared to list: id, nome, ip, marca, tipo, status, status_descricao, ultima_sincronizacao, tempo_sincronizacao and usuarios_online. It does not return total_usuarios or the alert configuration fields; for the full detail, use get with the returned id.

Error: Search query not provided (400).

GET /api/api.php?action=concentradora&operation=statistics

Overview of the PPPoE environment. No parameters.

curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=statistics"
response
{
  "success": true,
  "data": {
    "total_concentradoras": 4,
    "concentradoras_por_status": [
      { "status": 2, "status_descricao": "Normal", "total": 3 },
      { "status": 3, "status_descricao": "Warning", "total": 1 }
    ],
    "total_usuarios_pppoe": 2048,
    "usuarios_online": 1874,
    "usuarios_offline": 174,
    "top_concentradoras": [ { "id": 1, "nome": "BNG-01", "ip": "10.0.0.1", "usuarios_online": 388 } ]
  }
}

Usage examples

Listing concentrators and querying online users in the three languages:

# 1) list the concentrators  2) online users of concentrator 1
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=list"
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=concentradora&operation=get_users&id=1&status=online"
<?php
$url = 'https://ravi.yourprovider.com/api/api.php'
     . '?token=KEY&action=concentradora&operation=list';

$r = json_decode(file_get_contents($url), true);

if ($r['success']) {
    foreach ($r['data'] as $c) {
        echo $c['nome'] . ': ' . $c['usuarios_online'] . " online\n";
    }
}
import requests

r = requests.get("https://ravi.yourprovider.com/api/api.php",
                 params={"token": "KEY", "action": "concentradora",
                         "operation": "get_users", "id": 1, "status": "online"},
                 timeout=60)
data = r.json()

if data["success"]:
    for u in data["data"]:
        print(u["username"], u["ip"], u["ping_ms"])

There is no pagination: get_users on a large concentrator can return an extensive response. Filter by status when possible and avoid polling more frequently than the synchronization cycle, since the data only changes each cycle.


WhatsApp API

The action=whatsapp area sends messages through the WhatsApp number paired in Ravi (the same one used by the system alerts) and queries the connection status. Typical use: the provider's systems fire notices through a single already connected number, without maintaining another WhatsApp integration. It requires an API key with the WhatsApp Access permission checked.

Prerequisites

  • WhatsApp integration enabled in the system Settings. If it is off, every call responds {"msg":"WhatsApp API is disabled"}.
  • Number paired by QR code in Settings, Integrations tab. Without a paired session, the response is {"msg":"No client connected"}.
POST /api/api.php?action=whatsapp&operation=send

Sends a text message to one or more recipients.

ParameterTypeRequiredDescription
messagestringYesMessage text. Accepted alias: msg.
contactsstringYesRecipient(s), comma-separated. A plain number (e.g. 5531999999999) gets the individual contact suffix automatically; the full individual JID (e.g. 5531999999999@s.whatsapp.net) is also accepted; for groups, provide the JID ending in @g.us. Values that already contain @ are used exactly as sent.

Provide each number in full, with country code and area code, digits only (e.g. 5531999999999 for a Brazilian number). The API does not validate the format: an incomplete number or one with symbols becomes a recipient that does not exist on WhatsApp.

curl
curl -s -X POST "https://ravi.yourprovider.com/api/api.php" \
  -d "token=KEY" -d "action=whatsapp" -d "operation=send" \
  -d "contacts=5531988887777,5531977776666" \
  -d "message=Backup completed successfully"
response
{ "msg": "ok" }

Possible responses:

ResponseMeaning
{"msg":"ok"}All messages were sent.
{"msg":"Sending error","error":{"partial_success":true,"sent":X,"total":Y},...}Partial send: some of the recipients received it. Handle this case in the integration.
{"msg":"Message sending failed","debug_output":...}No message sent.
{"msg":"No client connected"}WhatsApp not paired or service down.
{"msg":"WhatsApp API is disabled"}Integration off in Settings.

Validation errors: Message cannot be empty, Please provide contacts, No valid contacts provided. All arrive with HTTP 200: check the msg field.

Sending uses the same paired number that fires the alerts of Ravi itself. Respect the WhatsApp sending limits: mass sends or sends outside the platform standards can get the number blocked, which also interrupts the system alerts.

GET /api/api.php?action=whatsapp&operation=status

Queries the integration status. A good health check before firing a batch of messages.

curl
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=whatsapp&operation=status"
response
{
  "status": {
    "system_enabled": true,
    "service_connected": true,
    "connection_status": "connected"
  }
}

system_enabled indicates the flag turned on in Settings; service_connected indicates whether the WhatsApp session is actually connected (live query to the service). connection_status takes only two values, connected or disconnected, mirroring the service_connected boolean: to decide programmatically, prefer testing service_connected.

Practical example: notify the NOC with a prior check

# check the connection and send
curl -s "https://ravi.yourprovider.com/api/api.php?token=KEY&action=whatsapp&operation=status"
curl -s -X POST "https://ravi.yourprovider.com/api/api.php" \
  -d "token=KEY" -d "action=whatsapp" -d "operation=send" \
  -d "contacts=5531988887777" -d "message=Maintenance window started"
<?php
$base  = 'https://ravi.yourprovider.com/api/api.php';
$token = 'KEY';

function ravi(array $params) {
    global $base, $token;
    $ch = curl_init($base);
    curl_setopt_array($ch, [
        CURLOPT_POST           => true,
        CURLOPT_POSTFIELDS     => http_build_query(['token' => $token] + $params),
        CURLOPT_RETURNTRANSFER => true,
    ]);
    $out = json_decode(curl_exec($ch), true);
    curl_close($ch);
    return $out;
}

$st = ravi(['action' => 'whatsapp', 'operation' => 'status']);
if (empty($st['status']['service_connected'])) {
    throw new RuntimeException('WhatsApp not connected');
}

$res = ravi(['action' => 'whatsapp', 'operation' => 'send',
             'contacts' => '5531988887777',
             'message'  => 'Maintenance window started']);

if (($res['msg'] ?? '') !== 'ok') {
    throw new RuntimeException('Send failed: ' . ($res['msg'] ?? '?'));
}
import requests

BASE  = "https://ravi.yourprovider.com/api/api.php"
TOKEN = "KEY"

def ravi(**params):
    r = requests.post(BASE, data={"token": TOKEN, **params}, timeout=60)
    return r.json()

st = ravi(action="whatsapp", operation="status")
if not st.get("status", {}).get("service_connected"):
    raise RuntimeError("WhatsApp not connected")

res = ravi(action="whatsapp", operation="send",
           contacts="5531988887777",
           message="Maintenance window started")

if res.get("msg") != "ok":
    raise RuntimeError(f"Send failed: {res.get('msg')}")

If the calls start responding No client connected, pair the number again by QR code in Settings, Integrations tab.