Content export resources

Trigger content export

Allows triggering a content export as zipped XML, containing all created content in the network. Requires the role Super Admin.

POST export/content
Parameter Type Default Required Description
anonymised Boolean true Whether the question poser should be exposed in the export
exclude_deleted Boolean false Whether deleted questions are excluded from the export

Response

The request will be returned, immediately. The export is running in the background.

{
    "export_id": 1,
    "start_date": "2015-11-26T16:39:19.000Z",
    "file_size": null,
    "user_id": 1,
    "end_date": null,
    "filename": "network_content_export_20151126.xml.zip",
    "status": "processing",
    "message": null
}

Available exports

Returns all content exports for the network. A finished export is indicated with status: "success".

GET export/content

Response

[
    {
        "export_id": 1,
        "start_date": "2015-11-20T16:10:19.000Z",
        "file_size": null,
        "user_id": 1,
        "end_date": null,
        "filename": "network_content_export_20151120-161019.xml.zip",
        "count": null,
        "status": "processing",
        "message": null
    },
    {
        "export_id": 2,
        "start_date": "2015-11-20T16:13:22.000Z",
        "file_size": 1129207,
        "user_id": 1,
        "end_date": "2015-11-20T16:15:12.000Z",
        "filename": "network_content_export_20151126-161322.xml.zip",
        "count": 17205,
        "status": "success",
        "message": null
    },
    {
        "export_id": 3,
        "start_date": "2015-11-26T16:00:00.000Z",
        "file_size": null,
        "user_id": 1,
        "end_date": null,
        "filename": "network_content_export_20151126-160000.xml.zip",
        "count": null,
        "status": "error",
        "message": "Error occurred"
    }
]

Export

Returns a content export by ID. Each export can have following states:

"success", "processing", "error".

If a content export is in status "success", the file_size (bytes), count (number of exported questions) and end_date will be provided, additionally.

GET export/content/:ID

Response

{
    "export_id": 2,
    "start_date": "2015-11-20T16:13:22.000Z",
    "file_size": 1129207,
    "user_id": 1,
    "end_date": "2015-11-20T16:15:12.000Z",
    "filename": "network_content_export_20151126-161322.xml.zip",
    "count": 17205,
    "status": "success",
    "message": null
}

Export download

Returns a compressed xml file containing the content export. A file can only be returned for exports in status:"success".

GET export/content/:ID/file

Response

network_content_export_20151126-161322.xml.zip

The returned xml can be validated by following xsd schema:

GET /public/export/content_export.xsd