The Activity History API provides a means to get the historical statistics for previous Activity runs.
API Entry points
/api/collections/name/activities/id/history: get statistics for the last 50 runs of the given Activity.
Get the History of a Data Source
GET /api/collections/collection/activities/id/history
Input
Path Parameters
| Key | Description |
|---|---|
| collection | The collection name. |
| id | The activity ID. Use 'all' for all activities. |
Query Parameters
None
Input Content
None
Output
Output Content
| Key | Type | Description |
|---|---|---|
| history | JSON map | Contains the following two fields (activity_started and activity_finished) in a JSON map. |
| activity_started | date string | When the activity began. |
| activity_finished | date string | When the activity finished. |
| id | integer | The ID of the activity, if the API call was not for a specific activity. |
Examples
Get a history of all activities:
Input
curl 'http://localhost:8888/api/collections/collection1/activities/all/history'
Output
[
{
"history": [
{
"activity_finished": "2011-03-18T04:44:39+0000",
"activity_started": "2011-03-18T04:44:39+0000"
}
],
"id": 9
},
{
"history": [
{
"activity_finished": "2011-03-18T0 4:44:44+0000",
"activity_started": "2011-03-18T04:44:44+0000"
}
],
"id": 10
},
{
"history" : [
{
"activity_finished": "2011-03-18T04:45:03+0000",
"activity_started": "2011-03-18T0 4:45:03+0000"
}
],
"id": 11
}
]
Get the history for activity number 9:
Input
curl 'http://localhost:8888/api/collections/collection1/activities/9/history'
Output
[
{
"activity_finished": "2011-03-18T04:44:39+0000",
"activity_started": "2011-03-18T04:44:39+0000"
}
]