Datasaur
Search…
Get Document Information

cURL

Use the following cURL command to get label sets added to a project. You can copy and paste the following template and replace the access_token and the content of the label set items according to your needs.
1
curl --location --request POST 'https://datasaur.ai/graphql' \
2
--header 'Authorization: Bearer a29a6b20588b7a350395a0b8942642cfbf33926c' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{ "operationName": "GetProjectDocumentQuery", "query": "query GetProjectDocumentQuery($documentId: ID!) { document: getTextDocument(fileId: $documentId) { id signature fileName } }", "variables": { "documentId": "c541e403-776a-40b7-af4b-955c7be86c0d" }}'
Copied!
Below is a more readable version of the above curl command's request body.
1
{
2
"operationName": "GetProjectDocumentQuery",
3
"query": "query GetProjectDocumentQuery($documentId: ID!) { document: getTextDocument(fileId: $documentId) { id signature fileName } }",
4
"variables": {
5
"documentId": "c541e403-776a-40b7-af4b-955c7be86c0d"
6
}
7
}
Copied!
  • operationName: you can fill any alphanumeric string in as the operationName. Refer this page for best practices on choosing an operationName .
  • variables:
    • documentId: string, reviewer's document ID of the project.
  • query: Copy this from the example above.
💡a tag has the same meaning as label. In the near future, we will update the GraphQL Schema to refer to all instances as labels.

Response

Here is the response you can expect after issuing the cURL command. Use the id to create the project.
1
{
2
"data": {
3
"document": {
4
"id": "c541e403-776a-40b7-af4b-955c7be86c0d",
5
"signature": "fab4a116af4da9d2381e61e8bf2337170d8d044704c4d679f439a79a04d7bddb",
6
"fileName": "Hamlet.txt"
7
}
8
},
9
"extensions": {}
10
}
Copied!
  • id: the unique ID of the document
  • signature: hash of the document. The value will change when the content (sentence / tokens) of the document change.
  • fileName: the name of the file
Last modified 2mo ago
Copy link
Contents
cURL
Response