WT AmoCRM library — Events

WT Amo CRM library - Documentation
Category: Libraries

Documentation for the WT AmoCRM WebhookEvent used to handle incoming AmoCRM webhooks in Joomla.

WT AmoCRM library - Events

WebhookEvent

Webtolk\Amocrm\Event\WebhookEvent extends Joomla\CMS\Event\AbstractEvent.

The event expects arguments['subject'] to contain an object with a toArray() method, for example a Registry instance.

Methods

  • getData(): array - the original webhook payload.
  • getAccount(): array - account data: id, subdomain, link.
  • getContacts(): array - contacts, if present in the webhook payload.
  • getLeads(): array - leads, if present in the webhook payload.
  • getTasks(): array - tasks, if present in the webhook payload.
  • getUnsorted(): array - unsorted items, if present in the webhook payload.
  • getMessages(): array - messages, if present in the webhook payload.

Example event handler

use Webtolk\Amocrm\Event\WebhookEvent;

public function onSomeWebhookEvent(WebhookEvent $event): void
{
    $leads = $event->getLeads();
    $contacts = $event->getContacts();

    // Continue with your business logic.
}

WebTolk Joomla Extensions

107 Extensions
12 Categories
546 Versions released
755263 Downloads