Developer documentation

Webhook is a way to receive notifications about events to your server.

POSSIBLE EVENTS

  • New lead
  • New payment

HOW TO USE Webhook

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']) 
{
   ...
}

DATA FORMAT

profile_idProfile ID
usernameUsername
nameContact name
emailEmail
phoneContact phone number
status_idLead status (1 - new, 2 - in progress, 3 - success, 4 - canceled)
contact_idStatus ID
block_idBlock ID (if it's a form or a store, then null)
order_idOrder ID
order_numberOrder number in the client's system
order_status_idOrder status (1 - not paid, 2 - paid, 3 - canceled, 4 - in progress, 5 - refund, 6 - pre-authorization (confirmation in your account is required)
purposePurpose of payment
tms_modifyLast order change date and time
budgetOrder budget
currency_codeOrder currency code
currency_titleOrder currency (symbol)
page_linkA link to a page where a lead was generated
lead_idLead ID
ipClient IP address
lead_numberLead number in the client's system
tms_createdLead creation date and time
recordsLead form fields
offersItems in the shopping cart
discountsPromo codes and promotional offers

A JSON DOCUMENT EXAMPLE

{  
   "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":""
   }
}

EXPECTED RESPONSE

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
15 minutes
215 minutes
315 minutes
41 hour
51 hour
62 hours
72 hours
84 hours

After that, the request will be removed, even if it has not been received.