Allocate Assessors to Participants Using the API

This use case covers how to use the WISEflow API to add assessors and allocate participants.

After a flow has been created, and participants has been added to the flow, it is possible to add assessors and allocate participants. Allocations can be created by matching assessorIds and participantIds directly in the institution backend, or allocations can be created in SIS:

API flow charts for service centre - Allocate assessors.png

Examples

Get Assessors on a Flow

With the GET /flow/{flowId}/assessors endpoint, all assessors currently on the flow will be returned. When assessors have been added to a flow, each assessor is given an assessor ID. This ID is unique per assessor, per flow. The "id" in the response is the assessor Id, used when allocating participants, in this example 8787. The response will also return basic information on the assessor that can be used to identify the assessor in a SIS. If participants have already been allocated to the assessor, the participant IDs will also be listed:

[
  {
    "participantIds": [
], "id": 8787, "type": 1, "assessorGroupIds": [
], "user": { "firstName": "Test", "lastName": "Assessor", "phone": "00000000", "externalIds": [ { "name": "UNIwise ID", "value": "test.assessor@uniwise.dk"
} ], "id": 1526
} } ]
Get Participants on a Flow
Participants are returned with the GET /flows/{flowId}/participants endpoint:

{
  "success": true,
  "data": [
    {
      "activated": true,
      "assessorGroupIds": [
        7,
        8
      ],
      "assessorIds": [
        5,
        6
      ],
      "groupId": 6,
      "number": 1,
      "participantId": 1,
      "submissionId": null,
      "user": {
        "firstName": "firstName",
        "lastName": "lastName",
        "phone": "phone",
        "externalIds": [
          {
            "name": "name",
            "value": "value"
          },
          {
            "name": "name",
            "value": "value"
          }
        ],
        "id": 2
      },
      "userId": 2
    }
  ],
  "error": null,
  "pagination": {
    "limit": 2,
    "offset": 0,
    "total": 5
  }
}
Allocate Assessors to Participants

With the assessor Id and the participant Id, the POST /flows/{flowId}/assessors/{assessorId}/allocations endpoint can be used to allocate assessors to participants. As parameters, the flowId is used to identify the flow, and the assessorId to identify the assessor. The request body is an array that takes one or more participantIds:

{
  "participantIds": [
    1,
2
] }

The above body will allocate the participant with ID 1 and 2 to the assessor. 

 

See Current Allocations

On a flow

After successfully having allocated assessors to a participant, current allocations can be returned with the GET /flows/{flowId}/assessors/{assessorId}/allocations endpoint. Here, the flowId is used to identify the flow and the assesorId to identify the assessor:

{
  "success": true,
  "data": {
    "participantIds": [
      1,
      2
] }, "error": null
}

 

On a participant

The GET /flows/{flowId}/participants/{participantId}/allocations endpoint return all allocations for a participant, this includes reviewers allocated to all participants. The flowId is used to identify the flow, and the participantId used to identify the participant:

{
  "success": true,
  "data": {
    "assessorIds": [
      8787
], "reviewerIds": [
] }, "error": null
}
Additional Allocations

The POST /flows/{flowId}/assessors/{assessorId}/allocations/participants/{participantId} lets you allocate additional participants to an assessor. The flowId is used to identify the flow, the assessorId used to identify the assessor, and the participantId to identify the participant. 

To allocate another participant, you first need the participantId. To find the participantId, call the GET /flows/{flowId}/participants as described above.

If the participant is successfully allocated to the participant, an HTTP code 204 is returned. 

Remove Allocations

If required, all participant allocations can be removed from the assessor with the DELETE /flows/{flowId}/assessors/{assessorId}/allocations endpoint, where the flowId identifies the flow and the assessorId identifies the assessor.

A single participant allocation can also be removed with the DELETE /flows/{flowId}/assessors/{assessorId}/allocations/participants/{participantId} endpoint. Using the participantId this endpoint will remove a single participant from the allocation. 

Was this article helpful?
0 out of 0 found this helpful

Articles in this section

See more