Skip to content

v1 APIs Documents

Siratee K edited this page May 20, 2021 · 10 revisions

v1 APIs Documents

Note: In Progress

NOTE!!: workDraft Structure:

{
  "outputDraft": ["ID",...] <--- ID is required,
  "fileDraft": "...."
}

This page contain the documents of v1 TA APIs

Definition

  1. ApiKey is the key that user generated from the TA Website. It is needed when the user want to access the TA online environment.
  2. WorkDraft is the scoring draft for the TA to grade the work. It's used to store the score report table draft.
  3. WorkId is the ID of the work. It's used to identify the work in the TA online services

Basic Connection

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 '....'

APIs List

This is the available APIs list

/v1/getWorkDraft/

Get Work Draft API

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."
}

Clone this wiki locally