AMO CRM
Integration options
Integration is to change and/or create contacts in enKod when the following events occur in AMO CRM:
- Adding a contact
- Changing a contact
- Adding a transaction
- Changing a transaction
Authorisation
1. Set webhook (one for all events or separate for each)
If you want, for example, to subscribe your contacts to a mailing group when one event occurs, but not when another event occurs, use separate webhooks.
The manager will provide you with the URL of the webhook to be installed in AMO → AMO Market → Webhooks
2. Select the required events
We support 4 types of events, changes in which are the trigger to change/add a contact in enKod.
- Adding a contact
- Changing a contact
- Adding a deal
- Changing a deal
Customise the four events that you require.
Working with contacts
Adding a contact in AMO → Adding/updating a contact in enKod
When adding a contact to AMO:
- the contact will be created in enKod if it was not found
- the contact will be updated in enKod if it was found
Changing a contact in AMO → Adding/updating a contact in enKod
When changing a contact in AMO:
- the contact will be created in enKod if it was not found
- the contact will be updated in enKod if it was found
Matching contact fields in AMO with data fields in enKod
A contact in AMO has two types of fields - system fields (existing initially, not displayed in the interface) and custom fields (manually created). The contact's email, phone number, first name and last name will be passed by default.
Processing system fields of a contact
In AMO, a contact has system fields:
Name | Value |
---|---|
id | contact card id |
responsible_user_id | responsible user id |
date_create | card creation date |
last_modified | date of last modification of the card |
created_user_id | creator id |
modified_user_id | modifier id |
account_id | account id |
For each system contact field that you want to pass to enKod, create a data field with a system name in the form of amo_contact_id
, amo_contact_name
, amo_contact_responsible_user_id
etc.
If you don't need to pass a field, just don't create it in enKod. Read the list of fields that we can and cannot process in this section. this section.
Processing custom fields:
In AMO, custom contact fields have their own unique id, which can be viewed here:
To pass such fields to enKod, create data fields in the service with system names in the form:
- amo_contact_1
- amo_contact_2
where 1 and 2 are id of user contact fields in AMO.
If you don't need to pass a field, just don't create it in enKod. Check out the list of fields we can and cannot handle in the this section.
Working with transactions
Adding and changing a contact in enKod when adding and changing a transaction in AMO
We can only associate a transaction with a contact if a custom field named email is created for the transaction entity in AMO.
In this case we can process events:
Adding a transaction to AMO → Adding/updating a contact in enKod
When adding a transaction to AMO:
- the contact will be created in enKod if it was not found
- the contact will be updated in enKod if it was found
Changing a transaction in AMO → Adding/updating a contact in enKod
When changing a transaction in AMO:
- the contact will be created in enKod if it was not found
- the contact will be updated in enKod if it was found
Matching transaction fields in AMO with contact data fields in enKod
A transaction in AMO has two types of fields - system fields (existing initially, almost all of them are not displayed in the interface) and custom fields (created manually).
Processing of system fields of a transaction
In AMO, a transaction has system fields:
Name | Value |
---|---|
id | transaction card id |
name | transaction name |
status_id | transaction status id |
price | transaction budget |
responsible_user_id | responsible user id |
last_modified | date of last card modification |
modified_user_id | user id |
created_user_id | creator id |
date_create | creation date |
pipeline_id | funnel id |
account_id | account id |
For each system transaction field to be passed to enKod, create a data field with a system name in the form of amo_lead_id
, amo_lead_name
, amo_lead_status_id
etc.
If you don't need to pass a field, just don't create it in enKod. Read the list of fields that we can and cannot handle in this section. this section.
Processing custom fields:
In AMO, custom transaction fields have their own unique id, which can be viewed here:
To pass such fields to enKod, create data fields in the service with system names in the form:
- amo_lead_1
- amo_lead_2
where 1 and 2 are the id of user transaction fields in AMO.
If you don't need to pass a field, just don't create it in enKod. Check out the list of fields we can and cannot process in the this section.
How contacts are matched
From AMO to enKod can come: email, multiple emails, email and phone, phone only, multiple phones. We can get multiple fields with emails or phones if they were added manually in AMO (custom fields).
- If several emails are received - we search for a contact in enKod by the first one, ignore the others
- If email and phone number are received - we search by email (if no one is found, we search by phone number).
- If only e-mail comes in, we search by e-mail.
- If only a phone number is received - search by phone.
If there is invalid value in the e-mail or phone number we match (for example, e-mail without dog, letters in the phone number), we do not process such requests (for cases when only e-mail or only phone number is sent). If we receive an email and a phone number, and one of the identifiers is invalid, we will search for a contact by the second (corrected) identifier.
If the contact was found, we update its fields.
If the contact was not found - we create it.
Data types of system fields in AMO and their correspondences in enKod
Contact system fields
Field in AMO | Field type in enKod |
---|---|
First Name | First and Last Name, passed by default, separated by space |
Email, passed by default. | |
Phone | Phone, transmitted by default |
id | Text or Number |
responsible_user_id | Text or Number |
date_create | Date and time |
last_modified | Date and time |
created_user_id | Text or Number |
modified_user_id | Text or Number |
account_id | Text or Number |
Transaction system fields
Field in AMO | Field type in enKod |
---|---|
id | Text or Number |
name | Text |
status_id | Text or Number |
price | Number |
responsible_user_id | Text or Number |
last_modified | Date and time |
modified_user_id | Text or Number |
created_user_id | Text or Number |
date_create | Date and time |
pipeline_id | Text or Number |
account_id | Text or Number |
Data types of user fields in AMO and their correspondences in enKod
Type in AMO | Type in enKod |
---|---|
Name | Name |
Phone | Phone |
Text | Text |
Number | Number |
Flag | Logical |
List | Do not process |
Multilist | Do not process |
Date | Date |
Link | Text |
Text area | Text |
Switch | Do not process |
Short address | Text |
Address | Do not process |
Birthday | Date |
Legal Entity | Do not process |
Date and time | Date and time |
File | Do not process |
Important
- If the same contact is linked to multiple transactions in AMO, we will only store the last modified one in the fields.
- If an email field is not created in a transaction in AMO, we will not be able to link the transaction to a contact in enKod.
- In enKod, only those fields of the contact that have been pre-created according to all rules will be modified.
- If an invalid email with a space in it is passed to enKod, we will replace the space with a plus. This is due to the logic of the webhooks in AMO. In this case, the contact will be added as valid.
Subscription to mailing groups
If necessary, you can subscribe contacts to mailing groups when adding them to enKod. In this case the subscription will work according to the logic of “everyone, including unsubscribers”, but contacts that are in Emergency or Civil Contingency will not be subscribed.
To subscribe, add the system names of the required groups after the main part of the URL in the following form:
https://wh.enkod.ru/amo/MzJjamJ1YXWZvZA==tfhodg/?groups=sysname1,sysname2