Update existing Charts, including their names and any other details, their status, and their data.
Making Requests
To update an individual Chart and its data in the JSON format, execute a PUT request to this URL:
https://api.kainexus.com/api/public/v1/json/item?fullSync=true
Authentication
The username will be "api" and the password will be the API Key. See this article for information on obtaining the API Key.
If you are using Curl to make the API call, refer to the following Curl script example:
curl -s -D - --user api:APIKEY https://api.kainexus.com/api/public/v1/json/itemUpdate?fullSync=true -d @FILEPATH
Things to note:
- By default, anyone who would be notified about changes you made to a Chart within KaiNexus will also be notified about those changes made with the Chart Update API.
- To suppress these notifications for an Item included in your import, add the following line to that Item's code segment. This line must be added for each Item for which notification should be suppressed.
"suppressNotifications": true
- All dates use ISO 8601 format. Example: "2019-04-29T16:30:40.000+0000"
- Only Charts the User has permission to edit will be successfully able to push the updates to
- The Chart(s) being updated must be referenced by ID.
See the JSON Chart Export API support page for more info on how to configure the API to export your Chart data via JSON.
Example JSON format for a Chart:
{
"item": {
"id": 4107,
"summary": "2020 PMA Approvals",
"chart": {
"id": 266,
"useDate": false,
"chartState": "PRIMARY_MET",
"chartType": "BAR_LINE",
"series": [
{
"id": 736,
"name": "2020 Forecast",
"type": "LINE",
"dataPoints": [
{
"id": 14214,
"value": 7.0,
"date": "2020-12-21T22:42:04.000+0000",
"category": "Jan",
"annotations": []
},
{
"id": 14219,
"value": 2.0,
"date": "2020-12-22T22:42:04.000+0000",
"category": "Feb",
"annotations": []
},
{
"id": 14215,
"value": 9.0,
"date": "2020-12-23T22:42:04.000+0000",
"category": "Mar",
"annotations": []
},
{
"id": 14220,
"value": 3.0,
"date": "2020-12-24T22:42:04.000+0000",
"category": "Apr",
"annotations": []
},
{
"id": 14209,
"value": 10.0,
"date": "2020-12-25T22:42:04.000+0000",
"category": "May",
"annotations": []
},
{
"id": 14213,
"value": 20.0,
"date": "2020-12-26T22:42:04.000+0000",
"category": "Jun",
"annotations": []
},
{
"id": 14218,
"value": 7.0,
"date": "2020-12-27T22:42:04.000+0000",
"category": "Jul",
"annotations": []
},
{
"id": 14212,
"value": 8.0,
"date": "2020-12-28T22:42:04.000+0000",
"category": "Aug",
"annotations": []
},
{
"id": 14211,
"value": 4.0,
"date": "2020-12-29T22:42:04.000+0000",
"category": "Sep",
"annotations": []
},
{
"id": 14216,
"value": 4.0,
"date": "2020-12-30T22:42:04.000+0000",
"category": "Oct",
"annotations": []
},
{
"id": 14210,
"value": 4.0,
"date": "2020-12-31T22:42:04.000+0000",
"category": "Nov",
"annotations": []
},
{
"id": 14217,
"value": 12.0,
"date": "2021-01-01T22:42:04.000+0000",
"category": "Dec",
"annotations": []
},
{
"id": 16650,
"value": 3.0,
"date": "2021-01-02T22:42:04.000+0000",
"category": "Jan",
"annotations": []
}
]
},
{
"id": 734,
"name": "2019",
"type": "LINE",
"dataPoints": [
{
"id": 14193,
"value": 9.0,
"date": "2020-12-21T22:42:04.000+0000",
"category": "Jan",
"annotations": []
},
{
"id": 14189,
"value": 2.0,
"date": "2020-12-22T22:42:04.000+0000",
"category": "Feb",
"annotations": []
},
{
"id": 14186,
"value": 4.0,
"date": "2020-12-23T22:42:04.000+0000",
"category": "Mar",
"annotations": []
},
{
"id": 14194,
"value": 19.0,
"date": "2020-12-24T22:42:04.000+0000",
"category": "Apr",
"annotations": []
},
{
"id": 14196,
"value": 14.0,
"date": "2020-12-25T22:42:04.000+0000",
"category": "May",
"annotations": []
},
{
"id": 14188,
"value": 7.0,
"date": "2020-12-26T22:42:04.000+0000",
"category": "Jun",
"annotations": []
},
{
"id": 14190,
"value": 12.0,
"date": "2020-12-27T22:42:04.000+0000",
"category": "Jul",
"annotations": []
},
{
"id": 14195,
"value": 8.0,
"date": "2020-12-28T22:42:04.000+0000",
"category": "Aug",
"annotations": []
},
{
"id": 14185,
"value": 3.0,
"date": "2020-12-29T22:42:04.000+0000",
"category": "Sep",
"annotations": []
},
{
"id": 14191,
"value": 6.0,
"date": "2020-12-30T22:42:04.000+0000",
"category": "Oct",
"annotations": []
},
{
"id": 14187,
"value": 9.0,
"date": "2020-12-31T22:42:04.000+0000",
"category": "Nov",
"annotations": []
},
{
"id": 14192,
"value": 7.0,
"date": "2021-01-01T22:42:04.000+0000",
"category": "Dec",
"annotations": []
},
{
"id": 16653,
"date": "2021-01-02T22:42:04.000+0000",
"category": "Jan",
"annotations": []
}
]
},
{
"id": 735,
"name": "2019 Approved PMA Starts",
"type": "THRESHOLD_PRIMARY",
"dataPoints": [
{
"id": 14207,
"value": 4.0,
"date": "2020-12-21T22:42:04.000+0000",
"category": "Jan",
"annotations": []
},
{
"id": 14198,
"value": 4.0,
"date": "2020-12-22T22:42:04.000+0000",
"category": "Feb",
"annotations": []
},
{
"id": 14208,
"value": 4.0,
"date": "2020-12-23T22:42:04.000+0000",
"category": "Mar",
"annotations": []
},
{
"id": 14205,
"value": 6.0,
"date": "2020-12-24T22:42:04.000+0000",
"category": "Apr",
"annotations": []
},
{
"id": 14204,
"value": 6.0,
"date": "2020-12-25T22:42:04.000+0000",
"category": "May",
"annotations": []
},
{
"id": 14201,
"value": 6.0,
"date": "2020-12-26T22:42:04.000+0000",
"category": "Jun",
"annotations": []
},
{
"id": 14202,
"value": 4.0,
"date": "2020-12-27T22:42:04.000+0000",
"category": "Jul",
"annotations": []
},
{
"id": 14199,
"value": 4.0,
"date": "2020-12-28T22:42:04.000+0000",
"category": "Aug",
"annotations": []
},
{
"id": 14200,
"value": 4.0,
"date": "2020-12-29T22:42:04.000+0000",
"category": "Sep",
"annotations": []
},
{
"id": 14206,
"value": 6.0,
"date": "2020-12-30T22:42:04.000+0000",
"category": "Oct",
"annotations": []
},
{
"id": 14197,
"value": 6.0,
"date": "2020-12-31T22:42:04.000+0000",
"category": "Nov",
"annotations": []
},
{
"id": 14203,
"value": 6.0,
"date": "2021-01-01T22:42:04.000+0000",
"category": "Dec",
"annotations": []
},
{
"id": 16654,
"value": 6.0,
"date": "2021-01-02T22:42:04.000+0000",
"category": "Jan",
"annotations": []
}
]
},
{
"id": 733,
"name": "2019 Actual",
"type": "BAR",
"dataPoints": [
{
"id": 14183,
"value": 5.0,
"date": "2020-12-21T22:42:04.000+0000",
"category": "Jan",
"annotations": []
},
{
"id": 14178,
"value": 7.0,
"date": "2020-12-22T22:42:04.000+0000",
"category": "Feb",
"annotations": []
},
{
"id": 14181,
"value": 12.0,
"date": "2020-12-23T22:42:04.000+0000",
"category": "Mar",
"annotations": []
},
{
"id": 14182,
"value": 20.0,
"date": "2020-12-24T22:42:04.000+0000",
"category": "Apr",
"annotations": []
},
{
"id": 14175,
"value": 4.0,
"date": "2020-12-25T22:42:04.000+0000",
"category": "May",
"annotations": []
},
{
"id": 14176,
"value": 3.0,
"date": "2020-12-26T22:42:04.000+0000",
"category": "Jun",
"annotations": []
},
{
"id": 14184,
"value": 14.0,
"date": "2020-12-27T22:42:04.000+0000",
"category": "Jul",
"annotations": []
},
{
"id": 14180,
"value": 23.0,
"date": "2020-12-28T22:42:04.000+0000",
"category": "Aug",
"annotations": []
},
{
"id": 14174,
"value": 12.0,
"date": "2020-12-29T22:42:04.000+0000",
"category": "Sep",
"annotations": []
},
{
"id": 14177,
"value": 4.0,
"date": "2020-12-30T22:42:04.000+0000",
"category": "Oct",
"annotations": []
},
{
"id": 14173,
"value": 16.0,
"date": "2020-12-31T22:42:04.000+0000",
"category": "Nov",
"annotations": []
},
{
"id": 14179,
"value": 22.0,
"date": "2021-01-01T22:42:04.000+0000",
"category": "Dec",
"annotations": []
},
{
"id": 16652,
"date": "2021-01-02T22:42:04.000+0000",
"category": "Jan",
"annotations": []
}
]
},
{
"id": 737,
"name": "Total",
"type": "LINE",
"dataPoints": [
{
"id": 14225,
"value": 1.8,
"date": "2020-12-21T22:42:04.000+0000",
"category": "Jan",
"annotations": []
},
{
"id": 14232,
"value": 0.2857142857142857,
"date": "2020-12-22T22:42:04.000+0000",
"category": "Feb",
"annotations": []
},
{
"id": 14221,
"value": 0.3333333333333333,
"date": "2020-12-23T22:42:04.000+0000",
"category": "Mar",
"annotations": []
},
{
"id": 14228,
"value": 0.95,
"date": "2020-12-24T22:42:04.000+0000",
"category": "Apr",
"annotations": []
},
{
"id": 14226,
"value": 3.5,
"date": "2020-12-25T22:42:04.000+0000",
"category": "May",
"annotations": []
},
{
"id": 14222,
"value": 2.3333333333333335,
"date": "2020-12-26T22:42:04.000+0000",
"category": "Jun",
"annotations": []
},
{
"id": 14229,
"value": 0.8571428571428571,
"date": "2020-12-27T22:42:04.000+0000",
"category": "Jul",
"annotations": []
},
{
"id": 14231,
"value": 0.34782608695652173,
"date": "2020-12-28T22:42:04.000+0000",
"category": "Aug",
"annotations": []
},
{
"id": 14230,
"value": 0.25,
"date": "2020-12-29T22:42:04.000+0000",
"category": "Sep",
"annotations": []
},
{
"id": 14223,
"value": 1.5,
"date": "2020-12-30T22:42:04.000+0000",
"category": "Oct",
"annotations": []
},
{
"id": 14224,
"value": 0.5625,
"date": "2020-12-31T22:42:04.000+0000",
"category": "Nov",
"annotations": []
},
{
"id": 14227,
"value": 0.3181818181818182,
"date": "2021-01-01T22:42:04.000+0000",
"category": "Dec",
"annotations": []
},
{
"id": 16651,
"date": "2021-01-02T22:42:04.000+0000",
"category": "Jan",
"annotations": []
}
]
}
]
},
"status": "NEW",
"chartType": "BAR_LINE",
"authors": [
{
"username": "showroom",
}
],
"participatingLocations": [],
"originatingLocations": [],
"responsibleLocations": [
{
"name": "Engineering"
}
],
"createDate": "2020-11-09T22:59:42.000+0000",
},
}
}