AlfaLeads API Documentation - Offer 4593
1. Sending information to our server
Our script takes parameters through the POST method.
Request should be posted to the URL:
http://alfashops.ru/api/leads/createThe request you send to our API is a JSON:API formatted array. The below is what your array should look like.
{
"data": {
"type": "Lead",
"attributes": {
"pid": 1,
"offerid": 4593,
"email": "example@gmail.com",
"ip": "185.183.105.158",
"user_agent": "Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/79.0.3945.88 Safari\/537.36"
}
}
}
Required attributes:
- pid - Your affiliate id
- offerid - Offer id
- email - User email
- ip - User IP address
- user_agent - User agent
Custom fields:
- sub1 - Custom field 1
- sub2 - Custom field 2
- sub3 - Custom field 3
- sub4 - Custom field 4
- sub5 - Custom field 5
API token
We provide token for API which you must send in the Authorization header:
Example CURL script:
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer SEdhQXM1NTR0TDVRakF3bHloRlppdz09",
),
2. API Responses
Success
{
"data": {
"type": "Lead",
"id": 1,
"attributes": {
"pid": 1,
"offerid": 4593,
"email": "example@gmail.com",
"ip": "185.183.105.158",
"user_agent": "Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/79.0.3945.88 Safari\/537.36",
"response": {
"code": 200,
"url": "hotincontri.it?xndal=EqDADE_2zYiKDM4XwQG-BGenV-vhFmtcu8HVAQBw6mkTHf66-iEfrayaivs0ewfu-Fm1lZq28jxzwFNZwRRcXv7mTmgP400sfQi-7zw2wpL9urFT8oesfoxM0K_Kv6--hLwmK99NNuu17nga3VDSGilc_0QkRwGM46U2q9vfE4XnUKxLNy_fli-RwkorZJL4VcWjlgUDLznY39EtP1rhbA&traffic=browser"
}
}
}
}
Invalid data
{
"data": {
"type": "Lead",
"id": 1,
"attributes": {
"pid": 1,
"offerid": 4593,
"email": "example@gmail.com",
"ip": "185.183.105.158",
"user_agent": "Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/79.0.3945.88 Safari\/537.36",
"response": {
"code": 400,
"message": "Ip is not valid: 185.183.105.158"
}
}
}
}
Incorrect API token
{
"status": 400,
"errors": {
"title": "API access token error!"
}
}
Incorrect offer id
{
"status": 400,
"errors": {
"title": "Offer offerid is not found!"
}
}
Incorrect pid
{
"status": 400,
"errors": {
"title": "Generating clickid error! Check your pid!"
}
}