Target API

This article provides sample API calls to manipulate Targets.

PRE-REQUISITES:

Create a new Target

Create a new Target

Item: target

Method: POST

Header:

Accept:application/json
Token:pp7463NsgbECHh5XIwfMLS5of8qFD5j4G3QohTCMh72kHyXH3K

Request example:

{
    "name": "Daily Revenue Target",
    "target_type": "1",
    "measure": "3",
    "dimension": "0",
    "measurement_interval": "3",
    "xtd_rollup_type": "calendar",
    "target_value_type": "integer"
}

NOTE: Target Name and combination of Target Type, Measure, Dimension and Measurement Interval must be unique across the system.

Enable Target

Enable Target

Item: target

Method: PUT

Actions: Enable

Header:

Accept:application/json
Token:1aoPDXz570JYvgpVtKLGkRMrpc8XfB8ZGEYGIteYKjG4hmoIsw

Request example:

call=enable

Add Datapoint

Add Datapoint

Item: target_data

Method: POST

Header:

Accept:application/json
Token:1aoPDXz570JYvgpVtKLGkRMrpc8XfB8ZGEYGIteYKjG4hmoIsw

Request example:

{
    "target": "95",
    "date": "2013-18-03",
    "value": "100"
}

Add Association

Add Association

Item: target_metric

Method: POST

Header:

Accept:application/json
Token:1aoPDXz570JYvgpVtKLGkRMrpc8XfB8ZGEYGIteYKjG4hmoIsw

Request example:

{
    "target": "80",
    "metric": "1396"
}

In this example an association between a Target 'Daily Bookings Forecast' (id 80) and a metric 'Daily Arrivals' (id 1396) has been established. In the Raw Response screen the id of this association is given ("id": "97").

Delete Association

Delete Association

Item: target_metric

Method: DELETE

Header:

Accept:application/json
Token:de7HCpSZjEu9l89RG44iaj67mucPcmQ7dUF2bV3WwNs4obbf2P