url_to_api
Specification¶
- Description:
-
Converts slicer url to the JSON format list of POST arguments required for the corresponding API request. See example.
-
URL:
-
URL arguments:
-
None
-
POST arguments (required unless marked optional):
-
token
: the authorization token (see Authentication). url
: slicer url from the browser address bar.
Output:
-
slicer_name
: the name of the slicer specified in theurl
POST argument. -
project_name
: the name of the project specified in theurl
POST argument. -
limit
: the maximum number of returned rows. The maximum allowed value is 10,000. -
split_by
: the array of the key fields used to split data in the form of ["key_field1",...]. -
include_mappings
: defines whether key field value mappings were returned. Possible values: 1 (mappings were returned), 0 (mappings were not returned). -
start_date
: thestart_date
value from the specifiedurl
POST argument. Format: YYYY-MM-DD. -
end_date
: theend_date
value from the specified url POST argument. Format: YYYY-MM-DD. -
include_others
: defines whether theother N items
link is displayed at the bottom of the data table for the slicer specified by the url POST argument. Possible values: 1 (N items
link is displayed), 0 (N items
link is not displayed). -
filters
(optional): the array of applied filters taken from theurl
POST argument. Array structure: -
[ {"name": "key_field",
"case\_insensitive"
: defines whether the search wascase-insensitive
. Possible values: (true -case-insensitive
, false -case-sensitive
)."search\_mappings"
: defines whether the search was performed inmappings
. Possible values: (true - search was performed in bothkey field values
and theirmappings
, false - search was performed inkey field values
only)."value"
: ["value1", ... ],-
"match"
: "equals|not equals|contains|not contains"}, ... ] , -
data_filters
(optional): the array of applied data filters specified in theurl
POST argument. Array structure: - [ {"name": "data_field",
- "value": "value1",
-
"match": "\<|>|\<=|>=”}, ... ] ,
-
data_fields
(optional): the array of data fields specified in theurl
POST argument. Format: -
[ "data_field1", .... ].
-
order_by
: defines sorting rules specified in theurl
POST argument. -
{"name" : "field",
-
"direction" : DESC/ASC}
Example¶
Purpose: Convert slicer url to the JSON format list of POST arguments required for the corresponding API request.
Path:
https://uslicer.iponweb.com/API/v2/url_to_api
POST Arguments:
{
"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"
]
}