Datasaur
Search…
Export Team Overview

cURL

Use the following cURL command to create a project. You can copy and paste the following template and replace the access_token, teamId, and method.
1
curl --location --request POST 'https://datasaur.ai/graphql' \
2
--header 'Authorization: Bearer access_token' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"query": "query ExportTeamOverview($input: ExportTeamOverviewInput!) { exportTeamOverview(input:$input) { exportId fileUrl } }",
6
"variables": {
7
"input": {
8
"teamId": "121",
9
"method": "FILE_STORAGE"
10
}
11
}
12
}'
Copied!
  • variables
    • input
      • teamId
      • method: define how the export result will be delivered. The most used methods are:
        • EMAIL
        • FILE_STORAGE

Response

EMAIL

If the method is set as email, the export result will be sent to access_token owner's email. Below is a sample response:
1
{
2
"data":{
3
"exportTeamOverview":{
4
"exportId":"ExportQueue:2d1cfa43-c612-45c7-8f91-fbca03932eb9",
5
"fileUrl":null
6
}
7
},
8
"extensions":{}
9
}
Copied!

FILE_STORAGE

If the method is set as FILE_STORAGE, the export result will be uploaded to Datasaur's temporary Amazon S3 bucket and the file URL is returned. Below is a sample response:
1
{
2
"data":{
3
"exportTeamOverview":{
4
"exportId":"ExportQueue:09df73b8-c38a-4238-a2d7-bde51dc9d293",
5
"fileUrl":"https://vulcan-prod-private.s3.amazonaws.com/export/team-overview/121/1643090963803/Team%20Overview%20-%20Team%20Alvin.zip?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAZ5X7NDLAVQ4BD4EC%2F20220125%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220125T060923Z&X-Amz-Expires=21600&X-Amz-Signature=315b6f89304f57ff47afdf388be5449f592b5be635d6d86e39a126a3ca6d3631&X-Amz-SignedHeaders=host"
6
}
7
},
8
"extensions":{}
9
}
Copied!
The client can download the file from the URL defined in fileUrl.
Note: fileUrl is returned optimistically, i.e the export result might have not been completely uploaded to the Amazon S3 bucket yet, so there might be a case where the file is not ready to be downloaded yet. To mitigate this issue, the client should poll the result using range request and only start downloading the result once the range request HTTP response code is 206.