Validation Queue
Table of contents
- 1. API Queue
- 1.1. HTTP Methods
- 1.1.1. GET /v1/reports
- 1.1.2. GET /v1/queue/{id}
- 1.2. Possible error messages
- 1.2.1. 401 Unauthorized
- 1.2.2. 404 Not Found
- 1.1. HTTP Methods
- 1. API Queue
- 1.1. HTTP Methods
- 1.1.1. GET /v1/reports
- 1.1.2. GET /v1/queue/{id}
- 1.2. Possible error messages
- 1.2.1. 401 Unauthorized
- 1.2.2. 404 Not Found
- 1.1. HTTP Methods
API Queue
Queue resource can list ongoing validations or fetch information about invidual validation.
Queue resource also uses automatic HTTP/1.1 303 See Other -redirection to /reports/{id} when validation is completed. This helps client side to use fetch available validation reports directly by polling the /queue/{id} -Resource.
HTTP Methods
GET /v1/reports
Returns list of items in queue.
Example Request
curl -k -H "Authorization: Bearer Token" https://<service_or_demo>.xmldation.com/api/v1/queue
Example Response
HTTP/1.1 200 OK
{ "queues" : { "queue" : [ { "status" : "processing", "created_at" : "2014-02-27 16:50:21", "id" : "63b379bf-b378-48d4-97a1-f0a80dc2e711" }, { "status" : "processing", "created_at" : "2014-02-27 16:50:22", "id" : "19088f08-0823-4d36-9448-40fc1c1243b5" }, { "status" : "new", "created_at" : "2014-02-27 16:50:25", "id" : "0abc4230-f050-4c3c-927b-4ca2c5c529ed" } ] } }
GET /v1/queue/{id}
Returns queue item in validation queue. In case validation is already completed, "HTTP/1.1 303 See Other" redirection is returned. Redirection points to /v1/reports/{id}. Additional information about Reports -resource can be found here.
Queue item can have 3 different statuses in the response body
- New = Validation of the file is pending and it's not yet started.
- Processing = Validation of the file is currently being processed.
- Completed = Validation is completed and is available in the Reports resource.
Example request
curl -k -H "Authorization: Bearer Token" https://<service_or_demo>.xmldation.com/api/v1/queue/69f4e0c2-16c6-4c91-97b0-16be708ec082 -L
Note: Adding -L parameter above, Curl will follow redirects sent by the server.
Example Response
HTTP/1.1 200 OK
{ "queue" : { "status" : "Processing", "message" : null, "updated_at" : 1393496784, "eta" : "7 minute(s)" } }
Possible error messages
401 Unauthorized
HTTP/1.1 Status 401 will be returned in case invalid credentials are provided. See additional information from Authentication
404 Not Found
HTTP/1.1 Status 404 will be returned if the requested queue item does not exists.
{ "error" : { "status" : 404, "message" : "Queue id not found", "extraInfo" : "https://wiki.xmldation.com/XMLdation_API_Service_Guide/v1/API_Resources/Validation_Queue" } }