Skip to content

Public data export

tudorgroza edited this page Feb 26, 2021 · 7 revisions

TOC

Export workflow

  1. Create export request - results in a requestId, which can then be used to poll for updates on the request
  2. Poll for status updates - use the requestId to retrieve an update on the export progress.

The request status takes the following values:

  • REQUESTED - status denoting a successful creation of the export request requestId
  • IN_PROGRESS - export task associated with requestId is in progress
  • FINALIZED - export task completed. Package can be retrieved.
  • FAILED - export task failed.
  1. Download package - the export results in a ZIP file containing a JSON export of the data, and can be retrieved using the requestId

EXPORT REQUEST

  • Endpoint: POST /public/v1/projects/{projectId}/export
  • Payload: empty
  • Response:
    • 201 | CREATED + requestId | STRING OR
    • 404 | NOT FOUND if projectId is inexistent

REQUEST STATUS

  • Endpoint: GET /public/v1/projects/{projectId}/export/{requestId}
  • Response:
200 | OK
{
  "requestId": "STRING",
  "status": "REQUESTED | IN_PROGRESS | FINALIZED | FAILED"
}

EXPORT DOWNLOAD

  • Endpoint: GET /public/v1/projects/{projectId}/export/{requestId}/download
  • Response: 200 | OK + byte array file content