url_to_api
POST /API/v2/url_to_api
Converts slicer url to the JSON format list of POST arguments required for the corresponding API request. See example.
Request body¶
url: slicer url from the browser address bar.
Response¶
status: the status of the request.success, if the request was processed successfully, or error code, if any error occurred. If the status is notsuccess, then the response contains thestatusandreasonfields only. Possible values:success: the request was processed successfully.bad_request: invalid request parameters, please see thereasonfield for more details.timeout: the request took too long to complete.access_error: the user doesn't have access to the specified project/slicer, or a wrong token was used.internal_error: the request failed due to an unknown problem.
reason: user-friendly description of the occurred error. This field is displayed for failed requests only.slicer_name: the name of the slicer specified in theurlPOST argument.project_name: the name of the project specified in theurlPOST 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_datevalue from the specifiedurlPOST argument. Format: YYYY-MM-DD.end_date: theend_datevalue from the specified url POST argument. Format: YYYY-MM-DD.include_others: defines whether theother N itemslink is displayed at the bottom of the data table for the slicer specified by the url POST argument. Possible values: 1 (N itemslink is displayed), 0 (N itemslink is not displayed).filters(optional): the array of applied filters taken from theurlPOST argument. Array structure:- [ {"name": "key_field",
"case_insensitive": defines whether the search wascase-insensitive. Possible values: (1 -case-insensitive, 0 -case-sensitive)."search_mappings": defines whether the search was performed inmappings. Possible values: (1 - search was performed in bothkey field valuesand theirmappings, 0 - search was performed inkey field valuesonly)."value": ["value1", ... ],"match": "equals|not equals|contains|not contains|beginswith|endswith|not beginswith|not endswith"}, ... ] ,
data_filters(optional): the array of applied data filters specified in theurlPOST argument. Array structure:- [ {"name": "data_field",
- "value": "value1",
- "match": "<|>|<=|>="}, ... ] ,
data_fields(optional): the array of data fields specified in theurlPOST argument. Format:- [ "data_field1", .... ].
order_by: defines sorting rules specified in theurlPOST 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
Request
{
"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=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>"
}
curl --data '{
"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=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" \
-H "Authorization: Bearer <token>" \
"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"
]
}