Types, Examples, and Response

In the article below you will find important information about the usage of the Testinvite’s API for fetching monitoring assets. We will firstly explain structure and types of the request body, and then show some examples of calls in Postman and in different programming languages. Lastly we will describe the structure of the response body.

If you want to try API requests immediately you can check the Postman collection we have created for you. Please click here to download the Postman collection.

Types

Request body for fetching monitoring assets have 3 required properties: "requester", "taskId", and "testInstanceId" Requester is an object containing properties related with authentication. Mainly you should include your organization's id and organization's private key in "auth" property of requester. "taskId" is the id of the task to which test instance belongs. "testInstanceId" is the id of the test instance whose monitoring assets will be fetched. You can find "testInstanceId" in the response of API call realted with fetching test results data.

You can find request body's types in chart below representing body in tree view.

  • Request body Type Information
    • taskId string, required Id of the exam
    • testInstanceId string, required Id of the test instance
    • requester object, required Container of organization info
      • name string, required Organization name
      • auth object, required Container of authentication properties
        • organizationId string, required Organization id
        • privateKey string, required Organization's private key

Examples

Fetching Monitoring Assets

In the examples below, you can see a request for fetching monitoring assets. The example on the left is created in POSTMAN, and the right one is created according to cURL. In the example all of required properties are provided. You can use his example simply by using your organization's id, private key, task and test instance ids.

Example body

{
  "requester": {
     "name": "Organization Name",
     "auth": {
        "organizationId": "zUH8oMYJ60As4HYP48Zx",
        "privateKey": "76f75bd0-4315-11ed-98ad-1127beb80c0d"
       }
     },
     "taskId": "Qj33evNTg7IjLnao2Ux1",
     "testInstanceId": "dpVWP3ZmYAiWe2PqpTxR"
}
          

cURL

curl --location --request POST 
'https://www.testinvite.com/api/v1/fatih/fetch-monitoring-assets' \
--header 'Content-Type: application/json' \
--data-raw '{
  "requester": {
  "name": "Organization Name",
  "auth": {
  "organizationId": "zUH8oMYJ60As4HYP48Zx",
  "privateKey": "76f75bd0-4315-11ed-98ad-1127beb80c0d"
    }
   },
   "taskId": "Qj33evNTg7IjLnao2Ux1",
   "testInstanceId": "dpVWP3ZmYAiWe2PqpTxR"
}'
          

Response Body

Response body mainly consists of two parts: "kind" and "payload". Kind property takes value according to the response status. If there is no error it should be "zetok", if there is it will be "zeterror". As it contains all data about monitoring assets, payload is the essential part of the response body.

In the payload object you should see "monitoringDocs" array consisting of objects where each object is containing data for one monitoring asset. Each object includes "id" and "data" properties. In data object all necessary information about the monitoring asset will be provided. In the "model" property of data you will find various properties such as "kind", "proctoringSummary", "url", and etc. We mentioned only essential property names here. Kind is the kind of the monitoring file. It will be either "video" or "screencapture" or "photo". Proctoring summary includes data of the monitoring options of the task. Finally, "url" is the link where you can find original file in our database.

In the tree view below you can see response body and its types.

  • Response body Type Information
    • kind string Kind of response according to status
    • payload object Container of response properties
      • monitoringDocs array Container of monitoring data
        • data object Container of monitoring asset.
          • model object Container of monitoring asset.
            • proctoringSummary object Container of proctoring's special data
            • taskId string Id of the task.
            • nth number Order of the monitoring asset.
            • testInstanceId string Id of the test instance.
            • url string URL of the asset's storage.

Response Example

You can see a shortened response example below for fetching monitoring assets. It only have one object in the "monitoringDocs" array. We shortened the response as its content covers to much area.

After having this response, it is recommended that you should save "kind" and "url" as they might be needed in the cheating attempt detections.

Response for creating single ticket with required properties

{
    "kind": "zetok",
    "payload": {
        "monitoringDocs": [
            {
                "id": "J0OE43FmGm110RE6xIxX",
                "data": {
                    "model": {
                        "proctoringSummary": {
                            "kind": "screenshot",
                            "detections": [],
                            "AIDetected": false,
                            "flag": 4
                        },
                        "taskId": "Qj33evNTg7IjLnao2Ux1",
                        "owner": {
                            "id": "6T9Y73UZg4DG0p3MvMmo",
                            "kind": "temp",
                            "participantMeta": {
                                "credential1": null,
                                "folder": "general",
                                "labels": [],
                                "fullname": "Single Ticket Creation",
                                "tagLines": [
                                    "requester",
                                    "requester_*/|-?*_Yusuf's Company"
                                ],
                                "group": "general",
                                "tagMap": {
                                    "requester": "Yusuf's Company"
                                }
                            }
                        },
                        "nth": 1,
                        "kind": "screenshot",
                        "testInstanceId": "dpVWP3ZmYAiWe2PqpTxR",
                        "url": "https://firebasestorage.googleapis.com/v0/b/
                        zetform-63ea7.appspot.com/o/organizations%2FzUH8oMYJ60As4HYP48Zx%
                        2Fmonitorings%2F6T9Y73UZg4DG0p3MvMmo%2Ftestinstances%2FdpVWP3ZmYAi
                        We2PqpTxR%2Fscreenshots%2FScreen_SCREENSHOT1_2022-10-06_11%3A13%3A32.
                        jpg?alt=media&token=92e94320-173f-4b55-93be-52ca86c1f11e",
                        "organizationId": "zUH8oMYJ60As4HYP48Zx"
                    },
                    "created": {
                        "_seconds": 1665044025,
                        "_nanoseconds": 369000000
                    }
                },
                "path": "testinstances/dpVWP3ZmYAiWe2PqpTxR/monitorings/J0OE43FmGm110RE6xIxX"
            },
                ]
        }
}