Difference between revisions of "Offerit REST API Get Conversion Caps"
From Offerit
OfferitRob (talk | contribs) (Created page with "{{Offerit Manual | show_rest_api_section = true }} == '''GET /offer/get_conversion_caps''' == '''Description''' *Offerit supports an API resource to get a list of configured...") |
OfferitRob (talk | contribs) |
||
| Line 104: | Line 104: | ||
"result": "success", | "result": "success", | ||
"message": "Caps found.", | "message": "Caps found.", | ||
| − | "data": [ | + | "data": [ |
| − | "cap_redirect_id": "2", | + | { |
| − | + | "cap_redirect_id": "1", | |
| − | + | "offerid": "2", | |
| − | + | "loginid": "each", | |
| − | + | "new_offerid": "5", | |
| − | + | "new_landing_pageid": "6", | |
| − | + | "track": "0", | |
| − | + | "type": "5", | |
| − | + | "value": "2", | |
| − | + | "deleted": "0", | |
| − | + | "enabled": "1", | |
| − | + | "duration": "0", | |
| − | + | "start": "1551296102", | |
| − | + | "end": "0", | |
| − | + | "timeframe_restriction": "0", | |
| − | + | "advertiserid": "all", | |
| − | + | "redirect_action": "landing_page", | |
| − | + | "admin_notify": "0", | |
| − | + | "start_nice": "2019/02/27 14:35:02", | |
| − | + | "end_nice": "Never", | |
| − | + | "type_nice": "Net Conversions", | |
| + | "duration_nice": "Day", | ||
| + | "timeframe_restriction_nice": "None" | ||
| + | }, | ||
| + | { | ||
| + | "cap_redirect_id": "2", | ||
| + | "offerid": "all", | ||
| + | "loginid": "all", | ||
| + | "track": "0", | ||
| + | "type": "0", | ||
| + | "value": "1", | ||
| + | "deleted": "0", | ||
| + | "enabled": "1", | ||
| + | "duration": "0", | ||
| + | "start": "1552422904", | ||
| + | "end": "0", | ||
| + | "timeframe_restriction": "0", | ||
| + | "advertiserid": "all", | ||
| + | "redirect_action": "none", | ||
| + | "admin_notify": "0", | ||
| + | "start_nice": "2019/03/12 16:35:04", | ||
| + | "end_nice": "Never", | ||
| + | "type_nice": "Conversions", | ||
| + | "duration_nice": "Day", | ||
| + | "timeframe_restriction_nice": "None" | ||
| + | } | ||
| + | ] | ||
} | } | ||
</pre> | </pre> | ||
Latest revision as of 14:30, 15 March 2019
GET /offer/get_conversion_caps
Description
- Offerit supports an API resource to get a list of configured conversion caps.
Resource URL
- http://domain/api/offer/get_conversion_caps
- Replace domain with the Offerit domain
- GET
Response Format
- JSON
- HTTP headers
Parameters
Parameters can be sent as url encoded params. All parameters are optional so if none are entered, all enabled conversion caps will be returned..
- offerid
- type: integer
- optional
- loginid
- type: string
- allowed values: all/each/loginid
- optional
- enabled
- type: integer
- allowed values: 0/1
- optional
- deleted
- type: integer
- allowed values: 0/1
- default: 0
- optional
- type
- type: string
- allowed values: Conversions/Dollars/Registrations/Unique Clicks/Clicks/Net Conversions
- optional
- duration
- type: string
- allowed values: Day, Week, Month, Year, All Time, Hour
- optional
- timeframe_restriction
- type: string
- allowed values: None/Weekdays/Weekends/Saturday/Sunday/Monday/Tuesday/Wednesday/Thursday/Friday
- optional
Example Code
PHP
<?php
$curl = curl_init();
$data = array(
'offerid' => '2',
);
$data_string = http_build_query($data);
$url = 'http://domain/api/offer/get_conversion_caps?'.$data_string;
$headers = array(
'api-key: 44b5498dbcb481a0d00b404c0169af62',
'api-username: productsupport'
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, $url);
$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);
?>
- Response:
{
"result": "success",
"message": "Caps found.",
"data": [
{
"cap_redirect_id": "1",
"offerid": "2",
"loginid": "each",
"new_offerid": "5",
"new_landing_pageid": "6",
"track": "0",
"type": "5",
"value": "2",
"deleted": "0",
"enabled": "1",
"duration": "0",
"start": "1551296102",
"end": "0",
"timeframe_restriction": "0",
"advertiserid": "all",
"redirect_action": "landing_page",
"admin_notify": "0",
"start_nice": "2019/02/27 14:35:02",
"end_nice": "Never",
"type_nice": "Net Conversions",
"duration_nice": "Day",
"timeframe_restriction_nice": "None"
},
{
"cap_redirect_id": "2",
"offerid": "all",
"loginid": "all",
"track": "0",
"type": "0",
"value": "1",
"deleted": "0",
"enabled": "1",
"duration": "0",
"start": "1552422904",
"end": "0",
"timeframe_restriction": "0",
"advertiserid": "all",
"redirect_action": "none",
"admin_notify": "0",
"start_nice": "2019/03/12 16:35:04",
"end_nice": "Never",
"type_nice": "Conversions",
"duration_nice": "Day",
"timeframe_restriction_nice": "None"
}
]
}