Skip to content

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

  • token: the authorization token (see Authentication).
  • 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 not success**, then the response contains the status and reason fields only. Possible values:
    • success: the request was processed successfully.
    • bad_request: invalid request parameters, please see the reason field 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 the url POST argument.

  • project_name: the name of the project specified in the url 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: the start_date value from the specified url POST argument. Format: YYYY-MM-DD.
  • end_date: the end_date value from the specified url POST argument. Format: YYYY-MM-DD.
  • include_others: defines whether the other 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 the url POST argument. Array structure:
    • [ {"name": "key_field",
    • "case_insensitive": defines whether the search was case-insensitive. Possible values: (1 - case-insensitive, 0 - case-sensitive).
    • "search_mappings": defines whether the search was performed in mappings. Possible values: (1 - search was performed in both key field values and their mappings, 0 - search was performed in key field values only).
    • "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 the url POST argument. Array structure:
    • [ {"name": "data_field",
    • "value": "value1",
    • "match": "<|>|<=|>=”}, ... ] ,
  • data_fields (optional): the array of data fields specified in the url POST argument. Format:
    • [ "data_field1", .... ].
  • order_by: defines sorting rules specified in the url 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

Request

{
  "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=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 '{
  "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=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"
  ]
}