Get Session
Retrieve information about a WhatsApp session.
Usage
The Session facade's get method may be used to retrieve information about a specific WhatsApp session. By default, it returns information about the default session. You can also specify a session name to retrieve information about a specific session.
php
use NjoguAmos\Waha\Facades\Session;
/** @var \Saloon\Http\Response $session */
$session = Session::get();php
use NjoguAmos\Waha\Facades\Session;
/** @var \Saloon\Http\Response $session */
$session = Session::get(session: 'custom-session');Response
The response returned by the get 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 SessionData DTO:
php
/** @var \Saloon\Http\Response $session */
$session->status(); // 200
$session->json(); // ["name" => "default", "status" => "WORKING", ...]php
use NjoguAmos\Waha\Enums\SessionStatus;
use NjoguAmos\Waha\Facades\Session;
/** @var \NjoguAmos\Waha\Dto\SessionData $session */
$session = Session::get()->dtoOrFail();
$session->name; // "default"
$session->status; // SessionStatus::WORKINGEngines
| WEBJS | WPP | NOWEB | GOWS |
|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ |