audience method
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "browser", "start_date": "2012-03-18", "end_date": "2012-03-31", "filters": [ { "name" : "geo_country", "value" : [ "US", "CA" ], "match" : "equals" }, { "name" : "browser", "value" : [ "MS" ], "match" : "contains" } ] }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "browser","start_date": "2012-03-18","end_date": "2012-03-20","filters": [{"name": "geo_country","value":["US", "CA"],"match": "equals"},{"name": "browser","value": ["MS"], "match": "contains"}]}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/audience"
Response:
{ "status" : "success", "total" : { "dates" : [ "2012-03-18", "2012-03-19", "2012-03-20" ], "data" : [ { "value" : 664019, "name" : "unique_users" } ], "records_found" : 5, "confidence_range" : "0.00245" }, "rows" : [ { "name" : [ "MSIE6" ], "data" : [ { "value" : 6210, "name" : "unique_users" } ], "confidence_range" : "0.02538" }, { "name" : [ "MSIE9" ], "data" : [ { "value" : 272940, "name" : "unique_users" } ], "confidence_range" : "0.00383" }, { "name" : [ "MSIEOther" ], "data" : [ { "value" : 27, "name" : "unique_users" } ], "confidence_range" : "0.37771" }, { "name" : [ "MSIE7" ], "data" : [ { "value" : 176570, "name" : "unique_users" } ], "confidence_range" : "0.00476" }, { "name" : [ "MSIE8" ], "data" : [ { "value" : 208284, "name" : "unique_users" } ], "confidence_range" : "0.00438" } ] }
delete_calc_mappings method
Purpose: Delete the calculation mapping created for the the geo_country key in the demo project.
Path:
https://uslicer.iponweb.com/API/v2/delete_calc_mappings
POST Arguments:
{ "project_name": "demo", "token": "<token>", "name" : "test_mapping" }
Command:
curl -d'{"project_name": "demo","token": "<token>","name":"test_mapping"}' "https://uslicer.iponweb.com/API/v2/delete_calc_mappings"
Response:
{"status": "success"}
delete_column method
Purpose: Delete a certain custom data column (custom_column_2211 in this example). Before testing this method please create a new custom data column by using the save_column method. The value of the name POST argument in this method should be equal to the value of the name parameter in the response of the the save_column method.
Path:
https://uslicer.iponweb.com/API/v2/delete_column
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "name" : "custom_column_2211" }
Command:
curl -d'{"slicer_name": "Traffic Demo","project_name": "demo","token": "<token>","name":"custom_column_2211"}' "https://uslicer.iponweb.com/API/v2/delete_column"
Response:
{"status": "success"}
export method
https://uslicer.iponweb.com/API/v2/export
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "campaign_id", "start_date": "2012-03-01", "end_date": "2012-03-03", "export_format": "csv", "filters" : [ { "name": "geo_region", "value": [ "California", "Texas" ], "match": "equals", "case_insensitive":1, "search_mappings":1 }, { "name": "campaign_id", "value": [ "100" ], "match": "contains" }, { "name" : "browser", "value": [ "Opera" ], "match" : "equals", "case_insensitive":1, "search_mappings":1 } ], "data_fields" : [ "imps", "bids", "clicks", "ctr", "custom_column_8565" ] }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "campaign_id","start_date": "2012-03-01","end_date": "2012-03-03", "export_format": "csv","filters": [{"name": "geo_region", "value":["California", "Texas"],"match": "equals", "case_insensitive":1,"search_mappings":1}, {"name": "campaign_id","value" :["100"],"match": "contains"}, {"name": "browser", "value":["Opera"], "match": "equals", "case_insensitive":1,"search_mappings":1}], "data_fields":["imps","bids","clicks","ctr","custom_column_8565"]}' -H "Content-Type: application/json" "https://uslicer.iponweb.com/API/v2/export"
Response:
"Campaign ID","Campaign ID Name","Impressions","Bids","Clicks","CTR","country" "10056","",32,0,0,0,0 "10065","",1018,25280,1,0.098,0 "10072","",951,17125,0,0,0
get mappings method
Purpose:Get mappings for the US and CA values of the geo-country
key field.
Path:
https://uslicer.iponweb.com/API/v2/get_mappings
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "search_mappings": [ { "key": "geo_country", "values": [ "US", "CA" ] } ] }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "search_mappings": [{"key": "geo_country", "values":["US", "CA"]}]}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/get_mappings"
Response:
{ "mappings" : { "geo_country" : { "US" : "United States", "CA" : "Canada" } }, "status" : "success" }
google_export method
Purpose: Export to Google Sheetsa Report on all Campaigns, containing the "100" string, displayed in California and Texas to users of the Opera internet browser for the period from March 01, 2012 to March 03, 2012.
Path:
https://uslicer.iponweb.com/API/v2/google_export
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "campaign_id", "start_date": "2011-02-16", "end_date": "2011-02-18", "email": [ "jsmith@gmail.com" ] "filters" : [ { "name": "geo_region", "value": [ "California", "Texas" ], "match": "equals" }, { "name": "campaign_id", "value": [ "100" ], "match": "contains" }, { "name" : "browser", "value": [ "Opera" ], "match" : "equals" } ] }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "campaign_id","start_date": "2012-03-01","end_date": "2012-03-03", "email": ["jsmith@gmail.com"],"filters": [{"name": "geo_region", "value":["California", "Texas"],"match": "equals"}, {"name": "campaign_id","value" :["100"],"match": "contains"}, {"name": "browser", "value":["Opera"], "match": "equals"} ]}' -H "Content-Type: application/json" "https://uslicer.iponweb.com/API/v2/google_export"
Response:
{ "status":"success" }
info method
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>" }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>"}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/info"
Response:
{ "key_fields" : [ { "description" : "Campaign ID", "type" : "int", "name" : "campaign_id", "is_segmented" : 0 }, { "description" : "Creative ID", "type" : "int", "name" : "creative_id", "is_segmented" : 0 }, { "name" : "conversion_id", "is_segmented" : 0, "description" : "Conversion ID", "type" : "int" }, { "name" : "size", "is_segmented" : 0, "description" : "Size", "type" : "text" }, { "name" : "geo_country", "is_segmented" : 0, "description" : "Geo Country", "type" : "text" }, { "description" : "Geo Region", "type" : "text", "name" : "geo_region", "is_segmented" : 0 }, { "type" : "text", "description" : "Geo City", "is_segmented" : 0, "name" : "geo_city" }, { "description" : "Geo Dma", "type" : "int", "name" : "geo_dma", "is_segmented" : 0 }, { "name" : "geo_zip", "is_segmented" : 0, "description" : "Geo Zip", "type" : "text" }, { "name" : "browser", "is_segmented" : 0, "description" : "Browser", "type" : "text" }, { "name" : "operating_system", "is_segmented" : 0, "description" : "Operating System", "type" : "text" }, { "name" : "google_main_vertical", "is_segmented" : 0, "description" : "Google Main Vertical", "type" : "int" }, { "name" : "language", "is_segmented" : 0, "description" : "Language", "type" : "text" }, { "description" : "Slot Visibility", "type" : "text", "name" : "slot_visibility", "is_segmented" : 0 }, { "link" : "domain", "name" : "domain", "is_segmented" : 0, "description" : "Domain", "type" : "text" }, { "description" : "Segments", "type" : "int", "name" : "segments", "is_segmented" : 1 }, { "type" : "text", "description" : "Year", "is_segmented" : 0, "name" : "granularity_year" }, { "name" : "granularity_quarter", "is_segmented" : 0, "description" : "Quarter", "type" : "text" }, { "name" : "granularity_month", "is_segmented" : 0, "description" : "Month", "type" : "text" }, { "type" : "text", "description" : "Week", "is_segmented" : 0, "name" : "granularity_week" }, { "is_segmented" : 0, "name" : "granularity_day", "type" : "text", "description" : "Day" } ], "timezone" : 0, "first_date" : "2012-02-01", "status" : "success", "last_date" : "2012-03-31", "annotation" : null, "data_fields" : [ { "display_type" : "int", "show_percents" : 2, "display_precision" : 0, "is_optional" : 0, "access" : null, "description" : "Impressions", "formula" : null, "name" : "imps", "formula_description" : null }, { "formula" : null, "description" : "Bids", "access" : null, "formula_description" : null, "name" : "bids", "display_type" : "int", "is_optional" : 0, "display_precision" : 0, "show_percents" : 2 }, { "access" : null, "description" : "Clicks", "formula" : null, "name" : "clicks", "formula_description" : null, "display_type" : "int", "show_percents" : 1, "display_precision" : 0, "is_optional" : 0 }, { "show_percents" : 0, "display_precision" : 3, "is_optional" : 0, "display_type" : "percent", "name" : "ctr", "formula_description" : "clicks / imps", "description" : "CTR", "formula" : "clicks / imps", "access" : null }, { "display_type" : "int", "display_precision" : 0, "show_percents" : 1, "is_optional" : 0, "description" : "PVC", "access" : null, "formula" : null, "name" : "pvc", "formula_description" : null }, { "formula_description" : null, "name" : "pcc", "access" : null, "description" : "PCC", "formula" : null, "is_optional" : 0, "display_precision" : 0, "show_percents" : 1, "display_type" : "int" }, { "description" : "Win Bid CPM", "formula" : "winner_bid_price / imps * 1000", "access" : null, "name" : "win_bid_shown", "formula_description" : "winner_bid_price / imps * 1000", "display_type" : "float", "display_precision" : 2, "show_percents" : 0, "is_optional" : 0 }, { "name" : "pub_payout", "formula_description" : null, "description" : "Cost", "access" : null, "formula" : null, "show_percents" : 1, "display_precision" : 2, "is_optional" : 0, "display_type" : "float" }, { "display_type" : "float", "show_percents" : 0, "display_precision" : 3, "is_optional" : 0, "description" : "eCPM", "access" : null, "formula" : "pub_payout / imps * 1000", "name" : "ecpm", "formula_description" : "pub_payout / imps * 1000" }, { "is_optional" : 0, "display_precision" : 3, "show_percents" : 0, "display_type" : "float", "formula_description" : "pub_payout / clicks", "name" : "ecpc", "description" : "eCPC", "formula" : "pub_payout / clicks", "access" : null }, { "display_type" : "int", "show_percents" : 0, "display_precision" : 0, "is_optional" : 1, "description" : "country", "access" : "private", "formula" : "map(test_mapping)", "name" : "custom_column_8565", "formula_description" : "map(test_mapping)" } ], "supports_timezone" : 0 }
list_calc_mappings method
Purpose: Display the list of all calculation mappings created in the demo project.
Path:
https://uslicer.iponweb.com/API/v2/list_calc_mappings
POST Arguments
{ "project_name": "demo", "token": "<token>" }
Command:
curl -d'{"project_name": "demo","token": "<token>"}' "https://uslicer.iponweb.com/API/v2/list_calc_mappings"
Response:
{ "status" : "success", "result" : [ { "author" : "test", "created" : "2018-01-23 16:12:55", "name" : "test_mapping", "mapped_key" : "country", "mappings" : { "US" : 10, "NL" : 20, "" : 56 } } ] }
query method
- imps
- clicks
- pub_payout
- ecpm
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by" : "campaign_id", "start_date" : "2012-03-01", "end_date" : "2012-03-03", "filters" : [ { "name" : "geo_region", "value" : [ "California", "Texas" ], "match" : "equals", "search_mappings": 1 }, { "name" : "campaign_id", "values" : [ "100" ], "match" : "contains" }, { "name" : "browser", "value" : [ "Opera" ], "match" : "equals" } ], "data_fields" : [ "imps", "clicks", "pub_payout","ecpm" ] }
Command:
curl --data '{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by": "campaign_id", "start_date": "2012-03-01", "end_date": "2012-03-03", "filters": [{"name": "geo_region", "value" :["California", "Texas"], "match": "equals", "search_mappings": 1}, {"name": "campaign_id", "value" :["100"], "match": "contains"}, {"name": "browser", "value" :["Opera"], "match": "equals"}], "data_fields" :["imps", "clicks", "pub_payout", "ecpm"]}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/query"
{ "status" : "success", "rows" : [ { "mapping" : null, "name" : "10065", "data" : [ { "value" : 1018, "percent" : "50.88339", "name" : "imps" }, { "value" : 1, "percent" : "100.00000", "name" : "clicks" }, { "value" : 0.29, "percent" : "30.36148", "name" : "pub_payout" }, { "value" : 0.29, "percent" : null, "name" : "ecpm" } ], "confidence_range" : "N/A" }, { "mapping" : null, "name" : "10072", "data" : [ { "value" : 951, "percent" : "47.52650", "name" : "imps" }, { "value" : 0, "percent" : "0.00000", "name" : "clicks" }, { "value" : 0.57, "percent" : "59.11783", "name" : "pub_payout" }, { "value" : 0.604, "percent" : null, "name" : "ecpm" } ], "confidence_range" : "N/A" }, { "mapping" : null, "name" : "10056", "data" : [ { "value" : 32, "percent" : "1.59011", "name" : "imps" }, { "value" : 0, "percent" : "0.00000", "name" : "clicks" }, { "value" : 0.1, "percent" : "10.52068", "name" : "pub_payout" }, { "value" : 3.211, "percent" : null, "name" : "ecpm" } ], "confidence_range" : "N/A" } ], "total" : { "dates" : [ "2012-03-01", "2012-03-02", "2012-03-03" ], "data" : [ { "value" : 2000, "name" : "imps" }, { "value" : 1, "name" : "clicks" }, { "value" : 0.97, "name" : "pub_payout" }, { "value" : 0.485, "name" : "ecpm" } ], "records_found" : 3, "confidence_range" : "N/A" } }
If no data exists for the specified combination of keys, values and match types, the response is as follows:
{ "status" : "success", "rows" : [], "total" : { "dates" : [ "2012-03-01", "2012-03-02", "2012-03-03" ], "data" : [ { "value" : 0, "name" : "imps" }, { "value" : 0, "name" : "clicks" }, { "value" : 0, "name" : "pub_payout" }, { "value" : 0, "name" : "ecpm" } ], "records_found" : 0, "confidence_range" : "N/A" } }
If you specify a wrong slicer name, the following error message is displayed:
{ "status" : "access_error", "reason" : "Wrong slicer name or slicer is unavailable" }
save_calc_mappings method
Purpose: Create a calculation mapping for the NL, US and (empty value) values of the geo_country key in the demo project.
Path:
https://uslicer.iponweb.com/API/v2/save_calc_mappings
POST Arguments:
{ "project_name": "demo", "token": "<token>", "name" : "test_mapping", "mapped_key" : "geo_country", "mappings" : [ { "key": "NL", "value": 20 }, { "key": "US", "value": 10 }, { "key": null, "value": 56 } ] }
Command:
curl -d'{"project_name": "demo", "name": "test_mapping", "mapped_key": "geo_country", "mappings": [{"key": "NL", "value": 20}, {"key": "US", "value": 10}, {"key": null, "value": 56}], "token": "<token>"}' "https://uslicer.iponweb.com/API/v2/save_calc_mappings"
Response:
{ "status" : "success" }
save_column method
Purpose: Create a custom data column with the following parameters:
- Formula: imps/bids
- Data type: float
- Number of displayed decimal places: 3
- Percent is not displayed
- Data column is selected by default
Path:
https://uslicer.iponweb.com/API/v2/save_column
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "description" : "custom", "access" : "shared", "formula" : "imps/bids", "display_type": "float", "display_precision" :"3", "show_percents": "0", "is_optional": "0" }
Command:
curl -d'{"slicer_name": "Traffic Demo","project_name": "demo","token": "<token>","description":"custom","access":"shared","formula":"imps/bids","display_type":"float","display_precision":"3","show_percents":"0","is_optional":"0"}' "https://uslicer.iponweb.com/API/v2/save_column"
Response:
{ "status" : "success", "name" : "custom_column_2211" }
time_series method
Purpose: Get Plots of Impressions related to Campaign 9861, occurred for users of Chrome and Firefox in California and Texas during the period from March 01, 2012 to March 03, 2012.
Path:
https://uslicer.iponweb.com/API/v2/time_series
POST Arguments:
{ "slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "split_by" : [ "campaign_id","geo_region" ], "start_date" : "2012-03-01", "end_date" : "2012-03-03", "granularity" : "day", "data_field" : "imps", "chart_lines" : [ "9861\u0002US-TX", "9861\u0002US-CA", ], "filters" : [ { "name" : "geo_region", "value" : [ "California", "Texas" ], "match" : "equals" }, { "name" : "campaign_id", "values" : [ "100" ], "match" : "contains" }, { "name" : "browser", "value" : [ "Opera" ], "match" : "equals" } ] }
Command:
curl --data '{"slicer_name": "Traffic Demo", "project_name": "demo", "token": "<token>", "data_field": "imps", "granularity": "day","split_by": ["campaign_id","geo_region"],"start_date": "2012-03-01","end_date": "2012-03-03", "chart_lines": ["9861\u0002US-TX", "9861\u0002US-CA"], "filters": [{"name": "geo_region", "value" :["California", "Texas"],"match": "equals"}, {"name": "campaign_id","value" :["100"],"match": "contains"}, {"key": "browser", "value" :["Opera"], "match": "equals"}]}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/time_series"
Response:
{ "mappings" : { "geo_region" : { "US-CA" : "California", "US-TX" : "Texas" }, "campaign_id" : { "9861" : null } }, "status" : "success", "rows" : [ { "9861\u0002US-CA" : 41677, "__time__" : "2012-03-01", "9861\u0002US-TX" : 14064 }, { "9861\u0002US-CA" : 27740, "__time__" : "2012-03-02", "9861\u0002US-TX" : 20234 }, { "9861\u0002US-CA" : 18672, "__time__" : "2012-03-03", "9861\u0002US-TX" : 20305 } ] }
url_to_api method
{ "token": "<token>", "url": "<url>" }
Command:
curl --data '{"token": "<token>","url": "https://uslicer.iponweb.com/demo/UI/Reports/Traffic%20Demo?category=geo_country&chart_column=imps&start_date=2012-03-18&end_date=2012-03-31&granularity=day&normalization=value&id_list=total&order_by=imps&order_direction=DESC&hide=pvc%2Cpcc%2Cwin_bid_shown%2Cpub_payout%2Cecpm%2Cecpc&version=17.6.11"}' -H "Content-Type: application/json" -H "Accept: application/json" "https://uslicer.iponweb.com/API/v2/url_to_api"
Response:
{ "include_mappings": 1, "project_name": "demo", "end_date": "2012-03-31", "split_by": ["geo_country"], "slicer_name": "traffic demo", "order_by": { "direction": "DESC", "name": "imps" }, "limit": 100, "need_others": 1, "start_date": "2012-03-18", "data_fields": [ "imps", "bids", "clicks", "ctr" ] }