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

{
  "success": true,
  "data": [
    {
      "participantId": 1,
      "userId": 2,
      "number": 1,
      "activated": true,
      "submissionId": null
    },
    {
      "participantId": 2,
      "userId": 3,
      "number": 2,
      "activated": true,
      "submissionId": 12345
    }
  ],
  "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 participants to an assessor. 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 that will be allocated to the assessor:

{
  "participantIds": [
    1,
2
] }

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

Allocate Additional Participants to the Assessor

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. 

See Current Allocations

Assessor Allocations

After successfully having allocated participants to an assessor, current allocations for the assessor 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
}

 

Participant Allocations

Assessors and reviewers can bothbe allocated to 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 paticipantId used to identify the participant:

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

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