Skip to content

save_calc_mappings

POST /API/v2/save_calc_mappings

Creates or updates calculation mappings. See example.

Request body

  • project_name: the name of the project.
  • name: mapping name (used in formulas as a link), unique across each project.
  • mapped_key: mapped key name.
  • mappings: an array of dictionaries with the following structure:
    • key: mapping key.
    • value: mapping value.

Response

Example

Create a calculation mapping for the NLUS and (empty value) values of the geo_country key in the demo project.

Path:

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

Request

{
  "project_name": "demo"
  "name" : "test_mapping",
  "mapped_key" : "geo_country",
  "mappings" : [
    {
      "key": "NL",
      "value": 20
    },
    {
      "key": "US",
      "value": 10
    },
    {
      "key": null,
      "value": 56
    }
  ]
}
curl --data '{
  "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>"
}' \
-H "Authorization: Bearer <token>" \
"https://uslicer.iponweb.com/API/v2/save_calc_mappings"

Response

{
  "status" : "success"
}