Skip to content

get_mappings

POST /API/v2/get_mappings

Matches identifiers to mappings for a particular key field. See example.

Request body

  • slicer_name: the name of the report.
  • project_name: the name of the project.
  • token: the authorization token (see Authentication).
  • search_mappings: an array with the following structure:
    • [ {"key": "key_field",
    • "values": ["value1", ... ]},...],

where "values" is an array of key field identifiers to search mappings for, and "key_field" is the name of the key field.

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.

  • mappings: a list of key field valuekey field value mapping pairs with the following structure:

    • {"key_field":
    • {"value1: "mapping1",...},...}

Example

Get mappings for the US and CA values of the geo-country key field.

Path:

https://uslicer.iponweb.com/API/v2/get_mappings

Request

{
  "slicer_name": "Traffic Demo",
  "project_name": "demo",
  "token": "<token>",
  "search_mappings": [
    {
      "key": "geo_country",
      "values": [
        "US", "CA"
      ]
    }
  ]
} 
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"
}