🚰 Downloading data with asstore¢

OverviewΒΆ

asstore is a time-limited task result store, which allows clients to retrieve the results of submitted tasks as and when they become available.

  • Task results are stored for a limited period before being expired and deleted
  • A task result may only be downloaded once; it is deleted once consumed

Fetching task resultsΒΆ

Once a client has satisfied themselves that a task has completed its results are available on asstore, the results can be retrieved with a simple request.

Note

Please consult asapi‘s querying task statuses documentation for instructions on how to get the status of a submitted task.

All authentication is performed using a token which must be present in the request’s Authorization header. In the following example request, the retrieval_endpoint value from the task status should be used to fetch the task’s results.

$ curl \
    -X GET \
    -H 'Authorization: Token <TOKEN>' \
    <RETRIEVAL_ENDPOINT> -D -

With a valid retrieval endpoint the result could look like this:

$ curl \
    -X GET \
    -H 'Authorization: Token <TOKEN>' \
    https://asstore.reincubate.com/fetch/asstore/de7d38ca-1d63-45d1-9036-824bbaeda4db -D -

Note

Once a task’s result has been consumed, the task status will contain an entry named result_retrieved which will be set to True. This indicates that the task result is no longer available.

If the result has already been consumed, the server’s will respond with an HTTP 404 in the following format:

HTTP/1.1 404 Not Found
Content-Type: application/json
...
{"message": "No results were found for this task id.", "success": false, "error": "task-result-not-found"}

Troubleshooting HTTP response codesΒΆ

Status Text Description
200 OK Everything is fine.
400 Bad Request Client has submitted invalid data.
401 Unauthorized Token is invalid.
404 Result Unavailable The requested task result does not exist: perhaps it has already been fetched.
503 Service Unavailable asstore is currently unavailable: check status.reincubate.com.