> For the complete documentation index, see [llms.txt](https://track360.gitbook.io/track360/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://track360.gitbook.io/track360/section-10-integrations/editor/10.2-leads-via-api.md).

# 10.2 Leads via API

* API feature allows two systems to communicate and exchange data automatically, without manual input.
* Types of API tools in Track360:
  * **Leads via API**: Affiliates send potential customers data (leads) directly into the CRM through Track360.
  * **API Reports**: External systems can fetch real-time reports and performance data from Track360.

{% hint style="info" %}
The functionality of **Leads via API** needs to be available and configured by your **tech provider**. Please check if the integration exists.
{% endhint %}

* Activation of Product’s API integration allows to receive **Leads via API**:
  * Track360 connects to the CRM to create Leads.
  * The affiliate connects to Track360 the Leads.
  * The affiliate is sending Leads to the CRM through Track360.
* Navigate into **Advertisers & Products > Products**

<figure><img src="/files/nJc9UWelV66nWvwsZPwM" alt=""><figcaption></figcaption></figure>

* Check if the product shows API Integration icon
  * If the **product displays the API Integration icon**, you can activate the Leads via API for the selected affiliate/IBs.
  * If the **product does not display the API Integration icon**, you need to contact Track360 Support Team Members to set it up.

### **Set API Integration on an Affiliate/IB**

* Navigate into **Affiliate Management**
* Select the affiliate or click to the arrow icon on the rightmost of the row. Click on the **selected Affiliate/IB** to see details&#x20;

<figure><img src="/files/iurO5Rh58qG0W7GHUlGi" alt=""><figcaption></figcaption></figure>

* Navigate into **API tab** to add API Integration or view the existing ones.

<figure><img src="/files/fqMjjJ9iUkgfwHn2aeqC" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
API Token Permission dropdown is not needed to set something up for Leads via API.
{% endhint %}

* **API Integrations** dropdown provides integration API options for each product already configured, such as Leads or Account Registration APIs.&#x20;
* Select the desired API and click **Add** to enable integration.

<figure><img src="/files/qzk9H66GLTx4TkVoaJLr" alt=""><figcaption></figcaption></figure>

* Once you added, the integrated API will be listed under **Existing API Integrations**
  * Use the **Delete** button, to delete the integration of the API for the selected Affiliate/IB
  * Use the **Edit** button to configure the API access for the particular affiliate/IB.

{% hint style="info" %}
To edit Existing API Integration for the affiliate/IB, refer to [subsection of API on 2.6 Open Affiliate Page](/track360/section-2-partner-management/editor/2.6-affiliate-details-page.md#api-tab)<br>
{% endhint %}

<figure><img src="/files/6BvEeJnfUVD4cszl3Lqp" alt=""><figcaption></figcaption></figure>

* **API Key** gives you the unique token for API integration.&#x20;
  * To generate the key, click the Plus button and copy the **token API** value&#x20;
  * To renew the key, click the **Extend Expiry Date** button to update its validity.

<figure><img src="/files/oNrMBQYuPXqPl1bbmEc5" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
The API Key is sensitive information. Share it only with the corresponding affiliate/IB and never expose it publicly.
{% endhint %}

* **Whitelisted IPs** to secure API access. Define the **From** and **To** fields to define a range of IP addresses or add a single IP. Then, click **Add** to save the IP(s) to the whitelist.
  * To allow the *full API range*, set the minimum (0.0.0.0) and maximum (255.255.255.255). Only set full range if you really want open access.
  * Additionally, find previously added IP ranges in the list with a trashcan icon to delete unwanted entries.

<figure><img src="/files/r4FxVEBkENokfqDi2E1B" alt=""><figcaption></figcaption></figure>

* Once all API details are configured. Copy the **API Key** value to provide it to the affiliate/IB.

### **Testing API**

* The **API testing Integration** helps verify that Leads are correctly sent to the Affiliate/IB’s CRM.

{% hint style="warning" %}
Testing will only work for affiliates/IBs that have been properly configured and have an API Token generated.

To **set up API integratio**n for an affiliate/IB, refer to[ 10.2 Set API Integration](/track360/section-10-integrations/editor/10.2-leads-via-api.md#set-api-integration-on-an-affiliate-ib) on an Affiliate/IB&#x20;
{% endhint %}

* Navigate into **Advertisers & Products > Products.**
* Click on the **Edit** action (pencil icon), on the rightmost side of the row, of the desired Product.

<figure><img src="/files/De9VYdljDAC9Ge5oMAsg" alt=""><figcaption></figcaption></figure>

* On **APIs input/output** tab, where each row determines an already configured Integration, select the action **Click here to test the API** on the desired one to test.

<figure><img src="/files/zwka4h26lk6RrVtSYyel" alt=""><figcaption></figcaption></figure>

* Choose an already configured affiliate/IB with API Permissions, and select a campaign. The API Token will be automatically filled up.

{% hint style="info" %}
If the API Token does not fill up it is necessary to go into Affiliate/IB’s Open Page and set the API Authentication. To generate it refer to[ 10.2 Set API Integration on an Affiliate/IB](#set-api-integration-on-an-affiliate-ib)
{% endhint %}

<figure><img src="/files/XQuNfxVrdJaDKx2xg1e9" alt=""><figcaption></figcaption></figure>

* Fill up the Lead Information details.
* There are two ways for **testing**,
  * Testing as a manager, choosing the desired affiliate/IB. [Test on Track360.](/track360/section-10-integrations/editor/10.2-leads-via-api.md#test-on-track360)
  * Testing as an affiliate/IB, using the JSON body. [Test on Postman](#test-on-postman).   &#x20;

### **Test on Track360**

* Once Integration is selected to **test**&#x20;
* Fill up the Lead Information details.

{% hint style="success" %}
Need to select an affiliate/IB which has already configured Leads via API, whitelist IP and API Token. To generate it refer to [10.2 Set API Integration on an Affiliate/IB.](#set-api-integration-on-an-affiliate-ib)
{% endhint %}

<figure><img src="/files/uSBPuXBMIs4Oh6lz9jPt" alt=""><figcaption></figcaption></figure>

* Click **test** to check the API operation
* Detailed summary of the API test will be displayed, where:
  * The left panel displays the full **HTTP Request body**, showing all parameters sent in the test (e.g., email, IP, product ID, campaign ID).
  * The right panel shows the **HTTP Response**, including status code, response message, and any error returned by the affiliate's API.

<figure><img src="/files/HN2EpytId0gF5kqgEGRA" alt=""><figcaption></figcaption></figure>

* Once tested, navigate into **Reports > Leads via API**. Run a report and review if a new row was generated with the Lead test.

<figure><img src="/files/K14wlz5PJSqSDesHS0Lp" alt=""><figcaption></figcaption></figure>

* Check information of Lead test as: affiliate id, campaign, country, email, name or any tracking parameter.
* Also, check on the Affiliate/IB’s CRM the test was created as a Lead

### Test on Postman

* With Postman the affiliate/IBs do not need extra permissions to test API Integration.&#x20;
* The affiliate/IB will be able to quickly adjust lead details on the json body and easily track errors or response details for testing purposes.
* Provide to the related affiliate/IB the corresponding information:
  * **Post URL**: send the URL using the dns configured plus the described content. Following as <https://tracking.brandname.com/webapi/api/affiliatemanagement/CreateAffiliateAPI>
  * **API Token and JSON Body**: copied from the test window, clicking on **View as JSON button** (explained below)

{% hint style="danger" %}
Be careful as this information is very sensitive data. *The API token is an authentication value unique and private for the corresponding affiliate/IB/employee.*
{% endhint %}

* Once Integration is selected to **test.**
* Fill up the Lead Information details.

<figure><img src="/files/1utQGyJLuDObgSIHVTx5" alt=""><figcaption></figcaption></figure>

* Click **View as JSON** to copy the API body clicking on **Copy JSON to Clipboard** (this JSON view will be useful needed for the affiliate to test)

<figure><img src="/files/kX6WN0rjBVx2N44qcgcu" alt=""><figcaption></figcaption></figure>

* On **Postman**, the affiliate/IB will select **POST as Method** and enter the Post URL. <https://tracking.brandname.com/webapi/api/affiliatemanagement/CreateAffiliateAPI>
* On the **Headers tab** fill up:
  * **Key**: Content-type&#x20;
  * **Value**: application/json

<figure><img src="/files/8exmXp5VZSNviwuNPIcb" alt=""><figcaption></figcaption></figure>

* On the **Body tab**, as raw and JSON type, paste JSON body of Test API integration of the platform.

<figure><img src="/files/yhzbQCZeA6U7DwLzp6u4" alt=""><figcaption></figcaption></figure>

* Test the API clicking on **Send** and analyse and share the result.

{% hint style="warning" %}
**Response text, success example**:

{

&#x20; "success": true,

&#x20; "autoLoginUrl": "//[www.affprogram.com/session/signin/?email=](http://www.affprogram.com/session/signin/?email=)<affiliateEmail@email.com>\&loginToken=fe961199-c3db-4dae-990a-a745522a0a8d"

}
{% endhint %}

{% hint style="warning" %}
**Response text, failure example**:\
**Success**

{

&#x20; "success": false,

&#x20; "error": "username already exist"

}
{% endhint %}

{% hint style="info" %}
To follow up the leads results, when they became a customer (such a SignUp or FTD), you can:

Set postbacks: Navigate into subsection Pixels/Postbacks, on Open Affiliate Page to set up postbacks to the affiliate/IB, follow up explanation on section [10.1 Postback/Pixel Integration](/track360/section-10-integrations/editor/10.1-postbacks-pixels-integration.md)

Leads via API Reports: Logged in as the desired affiliate/IB, navigate into section [10.3 Leads via API Reports ](/track360/section-10-integrations/editor/10.3-reports-via-api.md)to manage all APIs created under their performance.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://track360.gitbook.io/track360/section-10-integrations/editor/10.2-leads-via-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
