diff --git a/Polling-task-status.md b/Polling-task-status.md index cdf80cb..4cf3762 100644 --- a/Polling-task-status.md +++ b/Polling-task-status.md @@ -3,6 +3,53 @@ When a task is executed with the task API your retrieve a code. This code can be used to poll the status of a item task execution. -#### Get a list of item status tasks for a given item +The response 'message' field can contain a string message based on the context. -#### Get an item task status for a given item and item task code \ No newline at end of file +#### Get a list of status for a given item +> Request +```javascript +GET /api/v1/items/{code}/tasks +``` + +> Response 200 OK +```javascript +[ +{ + "taskType": "string", + "code": "string", + "message": "string", + "state": "Error, Ok, Scheduled, Processing", + "started": "2020-03-20T11:13:20.568Z", + "finished": "2020-03-20T11:13:20.568Z" +}, +{ + "taskType": "string", + "code": "string", + "state": "Error, Ok, Scheduled, Processing", +} +] +``` +Response 401 Not authenticated +Response 403 No READ permissions in parent item +Response 404 Parent Item not found + +#### Get the status of a task for a given item and item task code +> Request +```javascript +GET /api/v1/items/{code}/tasks/{itemTaskCode} +``` + +> Response 200 OK +```javascript +{ + "taskType": "string", + "code": "string", + "message": "string", + "state": "Error, Ok, Scheduled, Processing", + "started": "2020-03-20T11:13:20.568Z", + "finished": "2020-03-20T11:13:20.568Z" +} +``` +Response 401 Not authenticated +Response 403 No READ permissions in parent item +Response 404 Parent Item not found \ No newline at end of file