SendRegs API Manual ENG

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

SendRegs API manual

1
General logic

To post leads via SendRegs API you may use the following files with several specific editions:
 index.html - the example HTML form of fields, values that could be sent
 send.php - PHP script for sending data from HTML form of the landing page. Also, this script can read and
send user IP and defice useragent, read SendRegs API response and set auto redirection to different pages
in case of a successfull response.
 main.js - the example of a connected to HTML form script. This script reads GET-parameters from the landing
page URL and sends them to SendRegs API as hidden form fields (for example, to send tracker's click_id to
s2 parameter of a request).
Click HERE to download those files.

1. “send.php” file customization


The request to send data from a form of index.html page is processed by **send.php** file. To make it work you
have to make the following changes:

1. Customize GET-parameters to form out the correct link for the API request:
 [affiliate_id] - paste your affiliate_id from ClickDealer Affiliate portal
 [creative_id] - offer creative ID that you are setting up your integration for. You copy it from "Edit campaign"
page of ClickDealer Affiliate portal, or ask your AM
 [offer_contract_id] - offer contract ID, that you're setting up integration for. Usually, these IDs are added to
offer description, but also you can ask your AM for it
 [api_key] - your own unique API key, it can be found at ClickDealer Affiliate portal at Tools - API (API key
field)

2. Check the link to send data to SendRegs API ($url variable). Such link is added to the manual for each offer by
default. But, if you want to use your own custom domain, you may change it, considering this link structure:
https://trackingdomain.com/api?

3. You may need to set the redirect link ($defaultRedirectLink variable) in case of a successfull response.
In most cases, successful response contains a link to redirect user at Autologin_URL field. If you want to change such
funnel and redirect users to a different link, or in a case when offer doesn't have Autologin_URL, you may paste your
own link.
If you don't want to redirect users to any link, you need to comment the 57-59 and 61 lines of **send.php** file.

2
4. Set up the correct mapping to send values to the API request. Mapping is set by the default at each offers manual
separately, but you can change it in case of need.
To set up mapping, you need to modify the **send.php** file, starting from line 15 in a following format:

'name of a field in a form' => 'name of a parameter in API request'

If mapping of specific field was not set, form would send it through the HTML with the same parameter name as it
is in the HTML form.
IMPORTANT: parameter names of an API request has to be of the exact same as specified at offer description or
values would not be accepted correctly by the system. So you have to either name each field exactly according to
the parameter name in the HTML form, or add mapping to **send.php** file.

5. In case of an unsuccessful response, you may set up a message to show to a user in line 90 of **send.php** file.

3
2. “main.js” file customization
To read GET-parameters from a landing page you may use **main.js** scipt, that sends it as hidden fields to a form
to send it via API.
To read the list of parameters from a landing page URL and paste it to the HTML form, you need to specify it at line
14 of **main.js** file.

You need to add this script at the end of body, before closing </body> tag.

4
Your landing page is
ready for sending
leads via API ;)

You might also like