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.
curl --location --request POST'https://datasaur.ai/graphql' \--header 'Authorization: Bearer access_token' \--header 'Content-Type: application/json' \ --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" }}'
Below is a more readable version of the above curl command's request body.
{"operationName": "GetProjectLabelSetsQuery", "query": "query GetProjectLabelSetsQuery($fileId: ID!) { document: getTextDocument(fileId: $fileId) { id settings { labelSets { id index name tagItems { id parentId tagName color } } } } }",
"variables": {"fileId":"document-id" }}
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.