WT AmoCRM library (Joomla) — Entities API

WT Amo CRM library - Documentation
Category: Libraries

Reference for WT AmoCRM entities (Webtolk\Amocrm\Entities): concise summaries of the methods for leads, contacts, notes, tags, users, webhooks, and custom fields with usage snippets.

Documentation for AmoCRM entities provided by the Webtolk\Amocrm\Entities namespace.

Common usage pattern:

use Webtolk\Amocrm\Amocrm;

$amocrm = new Amocrm();

// All entities expose facade methods
$leads = $amocrm->leads()->getLeads(['limit' => 50]);
$contacts = $amocrm->contacts()->getContacts(['limit' => 50]);

Every method returns an object. On error it yields { error_code, error_message }.

Account

Webtolk\Amocrm\Entities\Account

  • getAccountInfo(): object — retrieves account information via /api/v4/account.

Example:

$account = $amocrm->account()->getAccountInfo();

Contacts

Webtolk\Amocrm\Entities\Contacts

  • getContacts(array $data = []): object — list contacts.
  • getContactById(int $contact_id, string $with = ''): object — load a contact by ID.
  • addContacts(array $data = []): object — bulk create contacts.
  • editContactsBatch(array $data): object — batch update.
  • editContact(int $contact_id, array $data): object — single update by ID.

Example payload:

$payload = [
    [
        'name' => 'Ivan Petrov',
        'custom_fields_values' => [
            [
                'field_code' => 'PHONE',
                'values' => [
                    ['enum_code' => 'WORK', 'value' => '+79990001122']
                ]
            ]
        ]
    ]
];

$result = $amocrm->contacts()->addContacts($payload);

Leads

Webtolk\Amocrm\Entities\Leads

  • getLeadsPiplines(): object — pipelines via /api/v4/leads/pipelines.
  • createLeadsComplex(array $data = []): object — complex creation.
  • createLeads(array $data): object — batch creation.
  • getLeadById(int $id, string $with = ''): object — load lead by ID.
  • getLeads(array $data = []): object — list leads.
  • editLeadsBatch(array $data): object — batch update.
  • editLead(int $lead_id, array $data): object — update single lead by ID.

Example (pipelines):

$pipelines = $amocrm->leads()->getLeadsPiplines();

Customfields

Webtolk\Amocrm\Entities\Customfields

  • getCustomFields(string $entity_type = 'leads', array $data = []): object — allowed types: leads, contacts, companies, customers.
  • getLeadsCustomFields(), getContactsCustomFields(), getCompaniesCustomFields(), getCustomersCustomFields() — helper shortcuts.
  • editCustomFieldsBatch(string $entity_type, array $data, ?int $entity_id = null): object — PATCH /api/v4/{entity_type}/custom_fields or /custom_fields/{id}.

Example:

$fields = $amocrm->customfields()->getContactsCustomFields(['limit' => 50]);

Notes

Webtolk\Amocrm\Entities\Notes

  • addNotes(string $entity_type = 'leads', int $entity_id = 0, array $notes = []): object
  • getNotes(string $entity_type, int $entity_id, array $params = []): object
  • editNotesBatch(string $entity_type, array $data): object
  • editNote(string $entity_type, int $entity_id, array $data, ?int $note_id = null): object

Allowed entity types: leads, contacts, companies, customers.

Example (adding a text note):

$notes = [
    [
        'entity_id' => 123456,
        'note_type' => 'common',
        'params' => ['text' => 'Comment from Joomla']
    ]
];

$result = $amocrm->notes()->addNotes('leads', 0, $notes);

Tags

Webtolk\Amocrm\Entities\Tags

  • getTags(string $entity_type = 'leads', array $data = []): object

Allowed types: leads, contacts, companies, customers.

Example:

$tags = $amocrm->tags()->getTags('leads', ['limit' => 100]);

Users

Webtolk\Amocrm\Entities\Users

  • getUsers(array $data = []): object — fetch users.
  • getUserById(int $user_id, string $with = ''): object — load user by ID.
  • addUsers(array $data): object — add users in bulk.
  • getRoles(array $data = []): object — list roles.

Example:

$users = $amocrm->users()->getUsers(['limit' => 50]);

Webhooks

Webtolk\Amocrm\Entities\Webhooks

  • getWebhooks(array $data = []): object — accepts filter[destination] (the URL is encoded).
  • addWebhook(array $data): object
  • deleteWebhook(string $destination): object
  • getJoomlaWebhookUrl(): string — builds the com_ajax endpoint for incoming webhooks.

Example subscription:

$data = [
    'destination' => $amocrm->webhooks()->getJoomlaWebhookUrl(),
    'settings' => ['lead_status', 'contact_add']
];

$result = $amocrm->webhooks()->addWebhook($data);

WebTolk Joomla Extensions

102 Extensions
12 Categories
519 Versions released
655007 Downloads