Postback URLs

List of Postback URLs

Parameters

HTTP method Access rights URL Parameters Note
GET opt_codes https://api.admitad.com/opt_codes/
  • limit**
  • offset**
  • campaign***
  • website***
  • order_by****

Returns the list of Postback URLs*.

GET opt_codes https://api.admitad.com/opt_codes/{id}/   Returns the postback url, where id is code identifier.*
  • * Returns the result in the JSON format.
  • ** Sets skipping and the number of records returned. For example limit=5&offset=2.
  • *** Filter by affiliate programs and pulisher’s ad spaces, respectively. For example, campaign=3&website=12, where the values are identifiers of the filtered categories.
  • **** Sorting order. Possible values:
    • action_type
    • method
    • desc_mode

Sign '-' before the value means inverse sort order. For example, order_by=-method&order_by=desc_mode.

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X GET https://api.admitad.com/opt_codes/?limit=2

curl -L -H 'Authorization: Bearer access_token' -X GET https://api.admitad.com/opt_codes/3/


Example of the response from the API server in the JSON format:

{
    "results": [
{
"campaign": null,
"desc_mode": 0,
"event": 0,
"generated_url": "http://127.0.0.1:8000/?oid=[[[offer_id]]]&oname=[[[offer_name]]]&ostat=[[[offer_status]]]",
"id": 11,
"method": 0,
"status": [
{
"id": 8
}
],
"user_url": "http://127.0.0.1:8000/",
"website": null,
"reward_ready": true
},
{
"campaign": null,
"desc_mode": 0,
"event": 0,
"generated_url": "http://127.0.0.1:8000/?1=[[[offer_id]]]&2=[[[offer_name]]]&3=[[[offer_status]]]&4=[[[offer_status]]]&6=[[[offer_status]]]&7=[[[offer_id]]]",
"id": 15,
"method": 0,
"status": [
{
"id": 5
}
],
"user_url": "http://127.0.0.1:8000/",
"website": null,
"reward_ready": false
}
],
"_meta": {
"count": 3,
"limit": 2,
"offset": 0
}
}

 

Description of API server response fields

Name Description
id Code ID
website Ad space of the code
campaign Affiliate program of the code
event The type of event that triggers the code (0 — action (conversion), 1 — changing program status, 2 — connecting a referral)
status Action status. Available only for actions (5 — new, 6 — accepted, 7 — rejected, 8 — pending)
reward_ready The reward has changed the status to or from "Ready for withdrawal". Applies only to actions
desc_mode Code setup mode (0 — advanced mode, 1 — easy mode)
action_type Type of action (0 — All types, 1 — Sale, 2 — Lead)
method Request method (0 — GET, 1 — POST)
user_url User URL
generated_url Generated URL

 

Create Postback URL by action

Parameters

HTTP method Access rights URL Parameters Note
POST manage_opt_codes https://api.admitad.com/opt_codes/action/create/ Parameter request list

* Returns the result in the JSON format.

Parameter request list

Name Type Required Settings restrictions Allowed values
website integer     The list of publisher's ad spaces
campaign integer     List of affiliate programs
desc_mode integer  

0 for advanced mode, and 1 for easy mode

url string    
method integer   0 for GET method, and 1 for POST method
action_type integer   0 for all action types, 1 for Sale, and 2 for Lead
status integer Transmission of at least one of the parameters: status or reward_ready is required   5 — new, 6 — accepted, 7 — rejected, 8 — pending
reward_ready integer  
  • 0 — do not receive any notifications about the reward changing its status to "Ready for withdrawal" or from it
  • 1 — Receive notifications when reward changes its status to "Ready for withdrawal" or from it

 

Name Parameter
Affiliate program ID [[[offer_id]]]
Name of affiliate program [[[offer_name]]]
Name of ad space [[[website_name]]]
Ad space ID [[[website_id]]]
SubID [[[subid]]]
Amount of your earnings [[[payment_sum]]]
The reward has changed the status to or from “Ready for withdrawal” [[[reward_ready]]]
Currency of the program [[[currency]]]
Order number [[[order_id]]]
Order amount [[[order_sum]]]
Click time (unix time) [[[click_time]]]
Duration (unix time) [[[time]]]
Conversion time (in seconds) [[[conversion_time]]]
Type of action [[[type]]]
Action IP [[[action_ip]]]
User-Agent [[[user_agent]]]

 

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X POST

https://api.admitad.com/opt_codes/action/create/ -d
'website=33&campaign=6&status=6&status=7&reward_ready=1&desc_mode=0&method=1&action_type=1&url=http%3A//test.com/%3Foffer_id%3D%5B%5B%5Boffer_id%5D%5D%5D%26time%3D%5B%5B%5Btime%5D%5D%5D'


Example of the response from the API server in the JSON format:

{
"campaign": {
"id": 6,
"name": "AdvCamp"
},
"desc_mode": 0,
"event":0,
"generated_url": "http://test.com/?offer_id=[[[offer_id]]]&time=[[[time]]]",
"id": 18,
"method": 1,
"status": [
{
"id": 6
},
{
"id": 7
}
],
"user_url": "http://test.com/",
"website": {
"id": 33,
"name": "AdRiver"
},
"reward_ready": true
}

Description of API server response fields

Creating of Postback URLs by the program status change

Parameters

HTTP method Access rights URL Parameters Note
POST manage_opt_codes https://api.admitad.com/opt_codes/offer/create/ Parameter request list

* Returns the result in the JSON format.

Name Parameter
Affiliate program ID [[[offer_id]]]
Name of affiliate program [[[offer_name]]]
Program status [[[offer_status]]]

 

Example of use

Example of a request with utility ``curl``

curl -L -H 'Authorization: Bearer access_token' -X POST

https://api.admitad.com/opt_codes/offer/create/ -d
'website=33&campaign=6&desc_mode=0&method=1&action_type=1&url=http%3A//test.com/%3Foffer_id%3D%5B%5B%5Boffer_id%5D%5D%5D%26offer_status%3D%5B%5B%5Boffer_status%5D%5D%5D'


Example of the response from the API server in the JSON format

{
"campaign": {
"id": 6,
"name": "AdvCamp"
},
"desc_mode": 0,
"event": 1,
"generated_url": "http://test.com/?offer_id=[[[offer_id]]]&offer_status=[[[offer_status]]]",
"id": 20,
"method": 1,
"status": [],
"user_url": "http://test.com/",
"website": {
"id": 33,
"name": "AdRiver"
},
}

Description of API server response fields

Editing Postback URL by action

Parameters

HTTP method Access rights URL Parameters Note
POST manage_opt_codes https://api.admitad.com/opt_codes/action/update/{id}/ Parameter request list

* Returns the result in the JSON format.

The list of link parameters

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X POST

https://api.admitad.com/opt_codes/action/update/24/ -d
'campaign=6&desc_mode=1&method=1&action_type=1&reward_ready=1'


Example of the response from the API server in the JSON format:

{
    "campaign": {
"id": 6,
"name": "AdvCamp"
},
"desc_mode": 0,
"event": 0,
"generated_url": "http://test.com/?offer_id=[[[offer_id]]]&offer_name=[[[offer_name]]]&website_name=[[[website_name]]]&website_id=[[[website_id]]]&subid=[[[subid]]]&payment_sum=[[[payment_sum]]]&reward_ready=[[[reward_ready]]]&currency=[[[currency]]]&order_id=[[[order_id]]]&order_sum=[[[order_sum]]]&click_time=[[[click_time]]]&time=[[[time]]]&conversion_time=[[[conversion_time]]]&type=[[[type]]]&action_ip=[[[action_ip]]]&user_agent=[[[user_agent]]]",
"id": 22,
"method": 1,
"status": [],
"user_url": "http://test.com/",
"website": {
"id": 33,
"name": "AdRiver"
},
"reward_ready": true
}

Description of API server response fields

Editing Postback URL by the program change status

Parameters

HTTP method Access rights URL Parameters

Note

POST manage_opt_codes https://api.admitad.com/opt_codes/offer/update/{id}/ Parameter request list

* Returns the result in the JSON format.

The list of link parameters

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X POST

https://api.admitad.com/opt_codes/offer/update/24/ -d
'campaign=6&desc_mode=1&method=1&action_type=1'

 

Example of the response from the API server in the JSON format:

{
    "campaign": {
"id": 6,
"name": "AdvCamp"
},
"desc_mode": 0,
"event": 1,
"generated_url": "http://test.com/?offer_id=[[[offer_id]]]&offer_name=[[[offer_name]]]",
"id": 21,
"method": 1,
"status": [],
"user_url": "http://test.com/",
"website": {
"id": 33,
"name": "AdRiver"
},
}

Description of API server response fields

Removing Postback URLs

Parameters

HTTP method Access rights URL Note
POST manage_opt_codes https://api.admitad.com/opt_codes/delete/{id}/ Returns the result of the operation, where id is the ad space ID*.

* Returns the result in the JSON format.

Example of use

Example of a request with utility ``curl``:

curl -L -H 'Authorization: Bearer access_token' -X POST https://api.admitad.com/opt_codes/delete/24/

 

Example of the response from the API server in the JSON format:

{"message": "The code record was deleted successfully", "success": "Deleted"}