Assignment API

Introduction

The Assignment API enables you to interact with task assignments for the current user or a specified user. This API is crucial for automating tasks, retrieving assignment details, and handling workflow assignments programmatically.

Plugin information

The Assignment API is designed to work with task assignments in Joget. It offers endpoints to complete, count, list, and reevaluate assignments based on the current user or a specified username.

Get started

Prerequisites

  • You must have a Joget account with appropriate access rights.
  • API key configuration must be completed in the Manage API Key UI menu.
  • Familiarity with HTTP methods (GET, POST).

Where to get the plugin

The Assignment API is available as part of the Joget platform and does not require additional installation. Ensure your Joget environment is properly set up and you can access the API functions.

How to use it

  1. Drag and drop the Assignment API from the Palette to the Canvas.
  2. Select the endpoints

 

List of API Endpoints

Complete assignment by username

Complete an assignment via a username, to continue the flow of a process instance.

URL: /assignment/completeByUser/{username}/{activityId}

HTTP Method: POST

Path Parameters
Parameter Description
username Username of a Joget user.
activityId Activity instance ID that is assigned to the specified user.
Query String Parameters
Parameter Description
variables Workflow variable value(s) to set. Can be multiple query parameters for many workflow variables.
Sample Response
{
  "activityId": "381_150_expenseclaim_process1_new_claim",
  "processId": "150_expenseclaim_process1",
  "nextActivityId": "..."
}

 

Complete assignment of current user

Complete an assignment of the currently logged-in user to continue the flow of a process instance.

This API method only works for Basic Access Authentication.
See here how to configure this setting in Manage API Key UI menu.

URL: /assignment/complete/{activityId}

HTTP Method: POST

Path Parameters
Parameter Description
activityId Activity instance ID that is assigned to the current user.
Query String Parameters
Parameter Description
variables Workflow variable value(s) to set. Can be multiple query parameters for many workflow variables.
Sample Response
{
  "activityId": "381_150_expenseclaim_process1_new_claim",
  "processId": "150_expenseclaim_process1",
  "nextActivityId": "..."
}

 

Count assignments by username

Count all assignments of a user via username.

URL: /assignment/countByUser/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Query String Parameters
Parameter Description
appId Filter assignments by App via App ID.
processDefId Filter assignments by belonging process via process definition ID.
processInstanceId Filter assignments by belonging process via process definition ID.
activityDefId Filter assignments by belonging activity via activity definition ID.
Sample Response
{
  "size": 4
}

 

Count assignments of current user

This endpoint counts all assignments for the currently logged-in user.

URL: /assignment/count

HTTP Method: GET

Query String Parameters
Parameter Description
appId Filter assignments by App via App ID.
processDefId Filter assignments by belonging process via process definition ID.
processInstanceId Filter assignments by belonging process via process definition ID.
activityDefId Filter assignments by belonging activity via activity definition ID.
Sample Response
{
  "size": 3
}

 

Get assignment detail by username

Get details of an assignment via a username and activity instance ID.

URL: /assignment/detailByUser/{username}/{activityId}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
activityId Activity instance ID that is assigned to the specified user.
Sample Response
{
  "activityId": "380_149_expenseclaim_process1_new_claim",
  "variables": {
    "SelectApprover": "admin",
    "status": ""
  },
  "dateCreated": "26-08-2019 07:29 PM",
  "serviceLevelMonitor": "-",
  "processId": "149_expenseclaim_process1",
  "processName": "Expense Approval Process",
  "due": "-",
  "activityName": "Claimant Edit",
  "description": "",
  "id": "380_149_expenseclaim_process1_new_claim",
  "label": "Claimant Edit",
  "processVersion": "7"
}

 

Get assignment detail of current user

Get details of an assignment that is assigned to the currently logged-in user via activity instance ID.

This API method only works for Basic Access Authentication.
See here how to configure this setting in Manage API Key UI menu.

URL: /assignment/detail/{activityId}

HTTP Method: GET

Path Parameters
Parameter Description
activityId Activity instance ID.
Sample Response
{
  "activityId": "380_149_expenseclaim_process1_new_claim",
  "variables": {
    "SelectApprover": "admin",
    "status": ""
  },
  "dateCreated": "26-08-2019 07:29 PM",
  "serviceLevelMonitor": "-",
  "processId": "149_expenseclaim_process1",
  "processName": "Expense Approval Process",
  "due": "-",
  "activityName": "Claimant Edit",
  "description": "",
  "id": "380_149_expenseclaim_process1_new_claim",
  "label": "Claimant Edit",
  "processVersion": "7"
}

 

List assignments by username

List all assignments of a user via username.

URL: /assignment/listByUser/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Query String Parameters
Parameter Description
appId Filter assignments by App via App ID.
processDefId Filter assignments by belonging process via process definition ID.
processInstanceId Filter assignments by belonging process via process definition ID.
activityDefId Filter assignments by belonging activity via activity definition ID.
sort Assignments data column to sort. Must be used in conjunction with sortDescending parameter.
sortDescending Sort the specified sort parameter value in ascending or descending order. Expect a boolean value. Must be used in conjunction with sort parameter.
startOffset Starting position of records to start query. Expect an integer.
pageSize Number of results to return. Expect an integer.
Sample Response
[
  {
    "activityId": "378_147_expenseclaim_process1_approve_claim",
    "dateCreated": "26-08-2019 07:29 PM",
    "serviceLevelMonitor": "-",
    "processId": "147_expenseclaim_process1",
    "processName": "Expense Approval Process",
    "due": "-",
    "activityName": "HOD Approve",
    "description": null,
    "id": "378_147_expenseclaim_process1_approve_claim",
    "label": "HOD Approve",
    "processVersion": "7"
  },
    .....
]

 

List assignments of current user

List all assignments of the currently logged in user.

This API method only works for Basic Access Authentication.
See here how to configure this setting in Manage API Key UI menu.

URL: /assignment/list

HTTP Method: GET

Query String Parameters
Parameter Description
appId Filter assignments by App via App ID.
processDefId Filter assignments by belonging process via process definition ID.
processInstanceId Filter assignments by belonging process via process definition ID.
activityDefId Filter assignments by belonging activity via activity definition ID.
sort Assignments data column to sort. Must be used in conjunction with sortDescending parameter.
sortDescending Sort the specified sort parameter value in ascending or descending order. Expect a boolean value. Must be used in conjunction with sort parameter.
startOffset Starting position of records to start query. Expect an integer.
pageSize Number of results to return. Expect an integer.
Sample Response
[
  {
    "activityId": "378_147_expenseclaim_process1_approve_claim",
    "dateCreated": "26-08-2019 07:29 PM",
    "serviceLevelMonitor": "-",
    "processId": "147_expenseclaim_process1",
    "processName": "Expense Approval Process",
    "due": "-",
    "activityName": "HOD Approve",
    "description": null,
    "id": "378_147_expenseclaim_process1_approve_claim",
    "label": "HOD Approve",
    "processVersion": "7"
  },
    .....
]

 

Reevaluate assignments by username

Reevaluate all assignments of a user via username.

URL: /assignment/reevaluateByUsername/{username}

HTTP Method: POST

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
{
  "date": "Tue Aug 27 18:37:49 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}

 

Reevaluate assignments of current user

Reevaluate all assignments of a user via username.

This API method only works for Basic Access Authentication.
See here how to configure this setting in Manage API Key UI menu.

URL: /assignment/reevaluate

HTTP Method: POST

Parameters
Parameter Description
- -
Sample Response
{
  "date": "Tue Aug 27 18:39:16 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}
Created by Julieth Last modified by Aadrian on Dec 03, 2024