Offerit REST API Dynamic Advertiser Revenue
From Offerit
Contents
POST /advertiser/dynamic_advertiser_revenue
Description
- adds revenue from an advertiser. This revenue isn't attached to any specific transaction and doesn't generate affiliate commissions.
- the required passthrough fields for the landing page url are %%aff_id%%, %%identid%% and %%device_tracking_id%%. These must be sent to the advertiser and returned as part of the post.
Resource URL
- http://domain/api/advertiser/dynamic_advertiser_revenue
- Replace domain with the Offerit domain
Response Format
- JSON
- POST
- HTTP headers
Parameters
Paremeters must be sent with the request body. The examples below show the parameters sent as x-www-form-urlencoded
- loginid
- type: integer
- required
- Loginid of affiliate (from %%aff_id%% landing page passthrough)
- identid
- type: integer
- required
- identid of surfer (from %%identid%% landing page passthrough)
- device_tracking_id
- type: integer
- required
- device_tracking_id of surfer (from %%device_tracking_id%% landing page passthrough)
- time
- type: string
- required
- time to insert this entry for (as yyyy-mm-dd hh:00:00)
- revenue
- type: decimal
- required
- Revenue for this entry (as xx.yy)
Example Request
POST
http://domain/api/affiliate/dynamic_advertiser_revenue inserts[1][identid]=111 inserts[1][loginid]=1 inserts[1][device_tracking_id]=1111 inserts[1][time]=2020-01-01 05:00:00 inserts[1][revenue]=11.22 inserts[2][identid]=22 inserts[2][loginid]=1 inserts[2][device_tracking_id]=2222 inserts[2][time]=2020-01-01 05:00:00 inserts[2][revenue]=22.22
- Response:
[ { "result":"Mixed Success"," "successes":[ 'Insert 2 Successful' ], "errors":[ 'Insert 1 Failed' ], } ]
Example Code
PHP
<?php $curl = curl_init(); $url = 'http://domain/api/affiliate/dynamic_advertiser_revenue'; $headers = array( 'api-key: 44b5498dbcb481a0d00b404c0169af62', 'api-username: productsupport' ); $data = array( inserts = Array( 1 = Array( 'loginid' => 1, 'identid' => 111, 'device_tracking_id' => '11111', 'time' => '2020-01-01 13:00:00', 'revenue' => '22.13' ), 2 = Array( 'loginid' => 1, 'identid' => 222, 'device_tracking_id' => '11111', 'time' => '2020-01-01 14:00:00', 'revenue' => '11.22' ), ) ); $resp = curl_exec($curl); //dumps an associative array representation of the json response $output = json_decode($resp, true); if($output !== NULL) { //json was valid. Dump the decoded array print_r($output); } else { //invalid json, just dump the raw response print_r($resp); } // Close request to clear up some resources curl_close($curl); ?>