Skip to content

Get Profile Picture

Get contact's profile picture URL.

Usage

The Contact facade's getProfilePicture method may be used to retrieve the profile picture URL for a specific contact.

php
use NjoguAmos\Waha\Facades\Contact;

/** @var \Saloon\Http\Response $response */
$response = Contact::getProfilePicture(
    contactId: '[email protected]',
    refresh: true, // Optional: force refresh the picture
    session: 'default'
);

WARNING

By default, photo is cached it 24 hours. Do not frequently refresh the picture to avoid rate-overlimit error.

Response

The response returned by the getProfilePicture method is an instance of Saloon\Http\Response. You may use the json method to retrieve the response as an array:

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

$response->status(); // 200
$response->json();   // ['profilePictureURL' => 'https://example.com/profile.jpg']

Engines

WEBJSWPPNOWEBGOWS

References

Released under the MIT License.