Exports API

The exports API allows you to create and manage your project’s Data Exports and saved queries for the Export Explorer.

Get Exports

GET /api/v1/administration/projects/:projectID/exports

Gets a list of all data exports. This report includes not only completed exports, but also ones that have been queued, are in progress, failed, etc. This gives you a full picture of your exports, similar to what you would see in MyDataHelps Designer.

Query Parameters

pageNumber integer

If the exports span multiple pages, this is the page number to request (0 by default, 0-indexed).

pageSize integer

The number of exports to return per page.

Response Fields

pageNumber integer

The page number requested (0-indexed).

totalExports integer

How many exports are available in total.

exports collection

The individual data exports.

exports.ID guid

Unique identifier for this export.

exports.dataStartDate date

Starting date for the range of data included in the export, in ISO8601 format.

exports.dataEndDate date

Ending date for the range of data included in the export, in ISO8601 format.

exports.insertDate date

Date the export was created, in ISO8601 format.

exports.runStartDate date

Date the export started running, in ISO8601 format.

exports.runEndDate date

Date the export finished running, in ISO8601 format.

exports.status string

Status of the export, one of: queued, exporting, uploading, finished, failed, or suspended.

exports.errorMessage string

A user-readable error message if the export failed. Will be null if the export was successful.

exports.exportType string

The type of export, either incremental or onDemand.

Sample Response
{
    "pageNumber": 0,
    "totalExports": 5,
    "exports": [
        {
            "id": "00629f26-3eb2-4223-9201-ef42e4ccdd32",
            "dataStartDate": "2022-08-30T20:39:18.93+00:00",
            "dataEndDate": "2022-09-19T00:00:00+00:00",
            "insertedDate": "2022-09-19T17:56:11.183-04:00",
            "status": "finished",
            "errorMessage": null,
            "runEndDate": "2022-09-19T17:57:12.923Z",
            "runStartDate": "2022-09-19T17:56:11.693Z",
            "exportType": "onDemand"
        },
        ...
    ]
}
{ "pageNumber": 0, "totalExports": 5, "exports": [ { "id": "00629f26-3eb2-4223-9201-ef42e4ccdd32", "dataStartDate": "2022-08-30T20:39:18.93+00:00", "dataEndDate": "2022-09-19T00:00:00+00:00", "insertedDate": "2022-09-19T17:56:11.183-04:00", "status": "finished", "errorMessage": null, "runEndDate": "2022-09-19T17:57:12.923Z", "runStartDate": "2022-09-19T17:56:11.693Z", "exportType": "onDemand" }, ... ] }

Download Export

GET /api/v1/administration/projects/:projectID/exports/:exportID/data

Downloads a specific export as a ZIP file.

The response’s Content-Disposition header will be set to attachment and include a recommended filename. For example: Content-Disposition: attachment; filename=RK.CareEvolution.Demo_20220830-20220916.zip

The ZIP file will contain each of the export files selected in the project settings. See the MyDataHelps export documentation for details on the file names and data formats.

You can only download successful exports. If the status of the requested export is anything other than finished, a 404-NotFound error response will result.


Get Saved Export Explorer Categories

GET api/v1/administration/projects/:projectID/exportexplorer/savedqueries/categories

Gets a list of categories used in your project’s saved Export Explorer queries.

Sample Response
[
    "Participants",
    "Other"
]
[ "Participants", "Other" ]

Query Saved Export Explorer Queries

GET api/v1/administration/projects/:projectID/exportexplorer/savedqueries

Searches your project’s saved Export Explorer queries.

Query Parameters

search string

Searches the name, description, and SQL text for the specified string.

name string

Searches by query name.

category string

Searches by query category.

canShare boolean

Reserved for future use.

limit int

How many entries to include in each page of results. Default and maximum is 100.

pageID string

Each page of results will return a nextPageID if there are additional pages that can be queried. Supply that to pageID to query the next page. When excluded, retrieves the first page.

Response Fields

results collection

A list of the saved Export Explorer queries matching the search criteria.

results[n].ID guid

Unique identifier for this query.

results[n].name string

Query name.

results[n].description string

Query description.

results[n].category string

Query category.

results[n].sql string

The SQL query details.

results[n].canShare boolean

Reserved for future use.

results[n].insertedDate date

Date the query was created, in ISO8601 format.

results[n].modifiedDate date

Date the query was last modified, in ISO8601 format.

results[n].insertedByUser string

User who created the query.

results[n].modifiedByUser string

User who last modified the query.

nextPageID string

Identifier that you can use to retrieve the next page of results.

Sample Response
{
    "results": [
        {
            "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1",
            "name": "Test",
            "description": "A test",
            "category": null,
            "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'",
            "canShare": false,
            "insertedDate": "2024-10-16T00:46:19.633Z",
            "modifiedDate": "2024-10-16T00:46:19.633Z",
            "insertedByUser": "myuser",
            "modifiedByUser": "myuser"
        },
        ...        
    ],
    "nextPageID": "1a0be6e0-34f5-455d-9190-4d00dc24738d"
}
{ "results": [ { "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1", "name": "Test", "description": "A test", "category": null, "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'", "canShare": false, "insertedDate": "2024-10-16T00:46:19.633Z", "modifiedDate": "2024-10-16T00:46:19.633Z", "insertedByUser": "myuser", "modifiedByUser": "myuser" }, ... ], "nextPageID": "1a0be6e0-34f5-455d-9190-4d00dc24738d" }

Get Saved Export Explorer Query

GET api/v1/administration/projects/:projectID/exportexplorer/savedqueries/:queryId

Gets a saved Export Explorer query.

Response Fields

ID guid

Unique identifier for this query.

name string

Query name.

description string

Query description.

category string

Query category.

sql string

The SQL query details.

canShare boolean

Reserved for future use.

insertedDate date

Date the query was created, in ISO8601 format.

modifiedDate date

Date the query was last modified, in ISO8601 format.

insertedByUser string

User who created the query.

modifiedByUser string

User who last modified the query.

Sample Response
{
    "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1",
    "name": "Test",
    "description": "A test",
    "category": null,
    "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'",
    "canShare": false,
    "insertedDate": "2024-10-16T00:46:19.633Z",
    "modifiedDate": "2024-10-16T00:46:19.633Z",
    "insertedByUser": "myuser",
    "modifiedByUser": "myuser"
}
{ "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1", "name": "Test", "description": "A test", "category": null, "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'", "canShare": false, "insertedDate": "2024-10-16T00:46:19.633Z", "modifiedDate": "2024-10-16T00:46:19.633Z", "insertedByUser": "myuser", "modifiedByUser": "myuser" }

Update Saved Export Explorer Query

POST api/v1/administration/projects/:projectID/exportexplorer/savedqueries/:queryId

Updates a saved Export Explorer query.

Body Parameters

ID guid

Unique identifier for the query to be updated.

name string

Query name.

description string

Query description.

category string

Query category.

sql string

The SQL query details.

canShare boolean

Reserved for future use.

Response Fields

actionTaken string

Indicates what action was taken on the query: add, update, delete, or none.

result object

The query record.

result.ID guid

Unique identifier for this query.

result.name string

Query name.

result.description string

Query description.

result.category string

Query category.

result.sql string

The SQL query details.

result.canShare boolean

Reserved for future use.

result.insertedDate date

Date the query was created, in ISO8601 format.

result.modifiedDate date

Date the query was last modified, in ISO8601 format.

result.insertedByUser string

User who created the query.

result.modifiedByUser string

User who last modified the query.

Sample Response
{
    "actionTaken": "update",
    "result": {
      "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1",
      "name": "Test",
      "description": "A test",
      "category": null,
      "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'",
      "canShare": false,
      "insertedDate": "2024-10-16T00:46:19.633Z",
      "modifiedDate": "2024-10-16T00:46:19.633Z",
      "insertedByUser": "myuser",
      "modifiedByUser": "myuser"
  }
}
{ "actionTaken": "update", "result": { "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1", "name": "Test", "description": "A test", "category": null, "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'", "canShare": false, "insertedDate": "2024-10-16T00:46:19.633Z", "modifiedDate": "2024-10-16T00:46:19.633Z", "insertedByUser": "myuser", "modifiedByUser": "myuser" } }

Delete Saved Export Explorer Query

DELETE api/v1/administration/projects/:projectID/exportexplorer/savedqueries/:queryId

Deletes a saved Export Explorer query.

Response Fields

actionTaken string

Indicates what action was taken on the query: add, update, delete, or none.

result object

The query record.

result.ID guid

Unique identifier for this query.

result.name string

Query name.

result.description string

Query description.

result.category string

Query category.

result.sql string

The SQL query details.

result.canShare boolean

Reserved for future use.

result.insertedDate date

Date the query was created, in ISO8601 format.

result.modifiedDate date

Date the query was last modified, in ISO8601 format.

result.insertedByUser string

User who created the query.

result.modifiedByUser string

User who last modified the query.

Sample Response
{
    "actionTaken": "delete",
    "result": {
      "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1",
      "name": "Test",
      "description": "A test",
      "category": null,
      "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'",
      "canShare": false,
      "insertedDate": "2024-10-16T00:46:19.633Z",
      "modifiedDate": "2024-10-16T00:46:19.633Z",
      "insertedByUser": "myuser",
      "modifiedByUser": "myuser"
  }
}
{ "actionTaken": "delete", "result": { "id": "980695bb-dc1d-4437-9cfe-a557c80b35a1", "name": "Test", "description": "A test", "category": null, "sql": "SELECT * FROM \"allparticipants\" WHERE participantidentifier='PT-123'", "canShare": false, "insertedDate": "2024-10-16T00:46:19.633Z", "modifiedDate": "2024-10-16T00:46:19.633Z", "insertedByUser": "myuser", "modifiedByUser": "myuser" } }