Skip to content

Get Server Status

Returns the server status, start timestamp, and uptime.

Usage

The Observability facade's status method may be used to get the server status.

php
use NjoguAmos\Waha\Facades\Observability;

/** @var \Saloon\Http\Response $status */
$status = Observability::status();

Response

The response returned by the status method is an instance of Saloon\Http\Response. You may use the json method to retrieve the response as an array or the dtoOrFail method to retrieve a ServerStatusData DTO:

php
/** @var \Saloon\Http\Response $status */

$status->status(); // 200
$status->json();   
/*
{
  "startTimestamp": 1723788847247,
  "uptime": 3600000
}
*/
php
use NjoguAmos\Waha\Facades\Observability;

/** @var \NjoguAmos\Waha\Dto\ServerStatusData $status */
$status = Observability::status()->dtoOrFail();

$status->startTimestamp; // \Carbon\CarbonImmutable instance
$status->uptime;         // 3600000

Engines

WEBJSWPPNOWEBGOWS

References

Released under the MIT License.