Developer documentation
Webhook is a way to receive notifications about events to your server.
- New lead
- New payment
To get started with Webhook, you need to connect the "Webhooks" module, select the necessary events and specify the corresponding URLs (links) which we will use to notify you about events.
We send HTTP POST requests. All requests have a signature which allows you to verify the request and make sure that the data is sent by us. The signature is sent via HTTP request headers named taplink-signature.
A code example if you're using the JSON data format:
$data = file_get_contents('php://input'); $_POST = json_decode($data, true); $signature = hash_hmac('sha1', $data, 'SECRET PHRASE'); if ($signature == $_SERVER['HTTP_TAPLINK_SIGNATURE']) { ... }
A code example if you're using the Form data format (Deprecated):
$signature = hash_hmac('sha1', json_encode($_POST, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES), 'SECRET PHRASE'); if ($signature == $_SERVER['HTTP_TAPLINK_SIGNATURE']) { ... }
profile_id | Profile ID |
username | Username |
name | Contact name |
phone | Contact phone number |
status_id | Lead status (1 - new, 2 - in progress, 3 - success, 4 - canceled) |
contact_id | Status ID |
block_id | Block ID (if it's a form or a store, then null) |
order_id | Order ID |
order_number | Order number in the client's system |
order_status_id | Order status (1 - not paid, 2 - paid, 3 - canceled, 4 - in progress, 5 - refund, 6 - pre-authorization (confirmation in your account is required) |
purpose | Purpose of payment |
tms_modify | Last order change date and time |
budget | Order budget |
currency_code | Order currency code |
currency_title | Order currency (symbol) |
page_link | A link to a page where a lead was generated |
lead_id | Lead ID |
ip | Client IP address |
lead_number | Lead number in the client's system |
tms_created | Lead creation date and time |
records | Lead form fields |
offers | Items in the shopping cart |
discounts | Promo codes and promotional offers |
{ "action":"leads.created", "data":{ "profile_id":"56", "username":"taplink.ru", "contact_id":"0", "block_id":"0", "page_link":"https://taplink.cc/taplink.ru", "lead_id":"0", "ip":"201.195.126.8", "lead_number":"0", "date_created":"2017-10-18", "tms_created":"2017-10-18 12:00:52", "records":[ { "value":"Jack", "type":"3", "title":"Name" }, { "value":"[email protected]", "type":"6", "title":"Email" } ], "name":"", "email":"", "phone":"" } }
When sending a request, information is considered accepted if you see HTTP response codes from 100 to 299, according to the w3.org.
The first attempt to send a request occurs immediately after the selected action. In case of an unsuccessful attempt, a re-sending will take place according to the rules presented in the table below.
Attempt number | Time since the last attempt |
1 | 5 minutes |
2 | 15 minutes |
3 | 15 minutes |
4 | 1 hour |
5 | 1 hour |
6 | 2 hours |
7 | 2 hours |
8 | 4 hours |
After that, the request will be removed, even if it has not been received.