Skip to content

App Data

NjoguAmos\Waha\Dto\AppData

The AppData DTO is used to represent an application configuration for a session.

Properties

PropertyTypeDescription
sessionstringThe name of the session the app belongs to.
appAppTypeThe type of the app.
enabledboolWhether the app is enabled. Default: true.
idstring?Optional unique identifier for the app.
configarrayConfiguration specific to the app type.

App Configurations

ChatWoot

For AppType::CHATWOOT, the config should include:

PropertyTypeDescription
urlstringChatWoot URL.
accountIdnumberChatWoot Account ID.
accountTokenstringChatWoot Account Token.
inboxIdnumberChatWoot Inbox ID.
inboxIdentifierstringChatWoot Inbox Identifier.
localestringLocale (e.g., en-US).

Calls

For AppType::CALLS, the config should include:

PropertyTypeDescription
dmobjectRules for direct messages (non-group calls).
groupobjectRules for group calls.

Each rule object should have:

PropertyTypeDescription
rejectboolWhether to reject calls.

Usage

php
use NjoguAmos\Waha\Dto\AppData;
use NjoguAmos\Waha\Enums\AppType;

$appData = new AppData(
    session: 'default',
    app: AppType::CHATWOOT,
    enabled: true,
    config: [
        'url' => 'https://chatwoot.example.com',
        'accountId' => 1,
        'accountToken' => 'token',
        'inboxId' => 1,
        'inboxIdentifier' => 'identifier',
        'locale' => 'en-US',
    ]
);

References

Released under the MIT License.