Get Known LIDs
Query all known LID-to-phone number mappings for a session.
TIP
Call Get all groups or Refresh groups to populate lid to phone number mapping for all groups.
Usage
You can use the Contact facade to query all known LIDs.
php
use NjoguAmos\Waha\Facades\Contact;
/** @var \Saloon\Http\Response $response */
$response = Contact::allLids(limit: 100, offset: 0);Response
The response returned by the allLids 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 an array of LidData DTOs:
php
/** @var \Saloon\Http\Response $response */
$response->status(); // 200
$response->json(); // [["lid" => "123123123@lid", "pn" => "[email protected]"]]php
use NjoguAmos\Waha\Facades\Contact;
/** @var \NjoguAmos\Waha\Dto\LidData[] $dtos */
$dtos = Contact::allLids()->dtoOrFail();
foreach ($dtos as $dto) {
$dto->lid; // "123123123@lid"
$dto->pn; // "[email protected]"
}Engines
| WEBJS | WPP | NOWEB | GOWS |
|---|---|---|---|
| ✅ | ✅ | ✅ | ✅ |