-
Notifications
You must be signed in to change notification settings - Fork 0
v1 APIs Documents
Siratee K edited this page May 20, 2021
·
10 revisions
Note: In Progress
NOTE!!: workDraft Structure:
{
"outputDraft": ["ID",...] <--- ID is required,
"fileDraft": "...."
}This page contain the documents of v1 TA APIs
- ApiKey is the key that user generated from the TA Website. It is needed when the user want to access the TA online environment.
- WorkDraft is the scoring draft for the TA to grade the work. It's used to store the score report table draft.
- WorkId is the ID of the work. It's used to identify the work in the TA online services
In order to connect to TA APIs. You will need to specify the ApiKey in the request headers property named Authorization and set the Content-Type of your request to be application/json since we accept only request with the JSON Body
$ curl -v -X POST {PREFIX}/v1/getWorkDraft \
-H 'Authorization: ApiKey' \
-H 'Content-Type: application/json' \
-d '....'This is the available APIs list
/v1/getWorkDraft/
This API will return the workDraft related to the workId in the request
Request Method: GET
Request body:
| Property | Value |
|---|---|
| workId | String |
Response:
| Property | Value |
|---|---|
| statusCode | int (The request status code) |
| message | String. (The overall information if the response) |
| requestId | String. (The requestId of this request) |
| workDraft | JSON. (If Success, The workDraft will be returned in this property) |
| errorDetails | String (If an Error occurred, (If any) The detail might be returned in this property) |
Example Request:
$ curl -v -X GET {PREFIX}/v1/getWorkDraft \
-H 'Authorization: ApiKey' \
-H 'Content-Type: application/json' \
-d '{
"workId": "testWork"
}'Success Response:
{
"statusCode": 200,
"message": "Success",
"requestId": "1621428876551-7h3",
"workDraft": {
"outputDraft": [
"a",
"b",
"score1"
],
"zipFileDraft": "{a}_{b}.zip"
}
}Error Response:
{
"statusCode": 400,
"message": "The workId you specified was not found.",
"requestId": "1621429594132-c1x"
}{
"statusCode": 500,
"message": "The work structure in the server is broken. Contact the administrator to resolve this ASAP.",
"requestId": "1621429798534-dxv",
"reasons": "The classroomId of this work is empty."
}