Datasaur
Search…
Get List of Label Sets in a Project
Beside adding label sets into a project, we may also want to update your label sets. Before updating, we need to obtain the ID of the label set for the project.

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 access_token' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{ "operationName": "GetProjectLabelSetsQuery", "query": "query GetProjectLabelSetsQuery($fileId: ID!) { document: getTextDocument(fileId: $fileId) { id signature settings { labelSets { id index name tagItems { id parentId tagName color } } } } }", "variables": { "fileId": "document-id" }}'
Copied!
Below is a more readable version of the above curl command's request body.
1
{
2
"operationName": "GetProjectLabelSetsQuery",
3
"query": "query GetProjectLabelSetsQuery($fileId: ID!) { document: getTextDocument(fileId: $fileId) { id settings { labelSets { id index name tagItems { id parentId tagName color } } } } }",
4
"variables": {
5
"fileId": "document-id"
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:
    • fileId: 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
"settings": {
6
"labelSets": [
7
{
8
"id": "4585972",
9
"index": 0,
10
"name": "POS",
11
"tagItems": [
12
{ "id": "PhvHFKDx0m1lA4bl46NhH", "color": null, "parentId": null, "tagName": "NOUN" },
13
{ "id": "zlFF5EBksh8vvjm36Pb7-", "color": null, "parentId": null, "tagName": "VERB" }
14
]
15
},
16
{
17
"id": "4586371",
18
"index": 1,
19
"name": "NER",
20
"signature": "67452b1cdb893096e521dbe9d1f9eeaea3a308bcaee2b9001f2c0b6d538172aa",
21
"tagItems": [
22
{ "id": "qgvxaa-svCwj18KIcoCBu", "color": "red", "parentId": null, "tagName": "PER" },
23
{ "id": "qgvxbb-svCwj18KIcoCBu", "color": "green", "parentId": null, "tagName": "GEO" },
24
{ "id": "qgvxMd-svCwj18KIcoCBu", "color": null, "parentId": null, "tagName": "GPE" }
25
]
26
}
27
]
28
}
29
}
30
},
31
"extensions": {}
32
}
Copied!
Copy link
Contents
cURL
Response