WebHooks

WebHooks is a notification of external applications by means of sending notifications about events that took place in amoCRM. You can configure HTTP-addresses of your applications and their associated operating rules in your account’s settings (API section).

Examples of scripts

  • After successful completion of a lead, you can send information about the occurred transaction to your money accounting application and automatically generate a bill.
  • You can add e-mails of new contacts in CRM system to a mailing list (e.g. UniSender).
  • You can configure SMS notifications about the changes made in your account.

List of supported entities

  • Lead
  • Contact
  • Company

List of possible events

  • Adding
  • Modification
  • Deletion

Description of parameters in settings

Field name Description
Name Sets the name for the WebHook.
URL Sets http-address of the external application.
Event Sets the list of events that will initiate WebHook sending to the indicated URL.

WebHook installation

WebHook installation includes three steps as follows:

  1. Adding a WebHook.
  2. Associating the WebHook with work processes.
  3. Testing integration.

To create a WebHook

  1. Go to Settings > API.
  2. Click “Add hook” in “WebHooks” section.
  3. Enter URL for this WebHook.
  1. Choose events, which will initiate notification sending.
  2. Click “Save”.

To test integration

  1. Make an action chosen during WebHook’s creation.
  2. Check data received from amoCRM in your application.
  3. If the no data was received, check correctness of the entered URL and move to item 1.

In which format the data are sent?

WebHook sends all information about the entity to the external application in format described in GET requests of the current section. POST variable contains an array of the following form: {“entity”:{“action”:{array of fields of entity}}} in case of creating and updating the entity, and also {“entity”:{“action”:”id”}} in case of deleting the entity.

Example array:

  1. {
  2.     "leads": {
  3.         "status": {
  4.             "id": "25399013",
  5.             "name": "Lead title",
  6.             "old_status_id": "7039101",
  7.             "status_id": "142",
  8.             "price": "0",
  9.             "responsible_user_id": "102525",
  10.             "last_modified": "1413554372",
  11.             "modified_user_id": "102525",
  12.             "created_user_id": "102525",
  13.             "date_create": "1413554349",
  14.             "account_id": "7039099",
  15.             "custom_fields": [
  16.                 {
  17.                     "id": "427183",
  18.                     "name": "Checkbox custom field",
  19.                     "values": ["1"]
  20.                 },
  21.                 {
  22.                     "id": "427271",
  23.                     "name": "Date custom field",
  24.                     "values": ["1412380800"]
  25.                 },
  26.                 {
  27.                     "id": "1069602",
  28.                     "name": "Checkbox custom field",
  29.                     "values": ["0"]
  30.                 },
  31.                 {
  32.                     "id": "427661",
  33.                     "name": "Text custom field",
  34.                     "values": ["Valera"]
  35.                 },
  36.                 {
  37.                     "id": "1075272",
  38.                     "name": "Date custom field",
  39.                     "values": ["1413331200"]
  40.                 }
  41.             ]
  42.         }
  43.     }
  44. }

Expected response

At request sending, the information is deemed accepted if code 200 is returned in the http header of the response (according to the table of status codes w3.org).

First attempt to send a request takes place immediately after making the selected action. In case the attempt is unsuccessful, one more sending attempt will take place in accordance with the rules shown in the table below.

If the seventh attempt will be unsuccessful, sending failure notification will be sent to the e-mail indicated in settings.

Number of attempts When the next attempt to send
2-3 15 minutes
4-5 60 minutes
6-7 24 hours