Group API

Introduction

The Group API allows you to manage groups and users in Joget's built-in directory manager. This includes adding, updating, deleting groups, and assigning or unassigning users to/from groups.

Plugin information

This API integrates with Joget’s directory manager to handle group management tasks programmatically.

Get started

How to use it

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

 

List of API End Points

Add group

Add a new group.

URL: /group

HTTP Method: POST

Body Parameters
Parameter Description
id Group ID.
name Group name.
description Description of group.
organization  
id

ID of the organization that this group belongs to.

This parameter is optional.

Sample Response
{
  "id": "apiTestGroup",
  "name": "API Test Group",
  "description": "This is a group created by API.",
  "organization": {
    "id": "ORG-001"
  }
}

 

Assign user to group

Assign a Joget user to a group.

URL: /group/assignUser/{group}/{username}

HTTP Method: POST

Path Parameters
Parameter Description
group Group ID.
username Username of Joget user.
Sample Response
{
  "username": "cat",
  "groups": [
    {
        "id": "G-004",
        "name": "API Test Group",
        "description": "This is API generated group.",
        "organizationId": "ORG-001"
    }
  ]
}

 

Delete group

Delete a group via group ID.

URL: /group/{id}

HTTP Method: DELETE

Path Parameters
Parameter Description
id Group ID.
Sample Response
{
  "date": "Wed Aug 28 16:13:00 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}

 

Find group by username

Find the group that belongs to the specified user via username.

URL: /group/findByUser/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of Joget user.
Query String Parameters
Parameter Description
nameFilter Filters the response via group ID.
organizationId Filter groups that belong to an organization via organization ID.
inGroup Search for the group(s) that the user belongs or does not belong to. Expect a boolean value.
sort Group 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
[
  {
    "id": "G-001",
    "name": "Managers",
    "description": "",
    "organization": {
        "id": "ORG-001"
    }
  }
]

 

Find group

Get all groups by default.

Able to filter or sort the returned results via parameters.

URL: /group/find

HTTP Method: GET

Query String Parameters
Parameter Description
nameFilter Filters the response via group ID.
organizationId Filter groups that belong to an organization via organization ID.
sort Group 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
[
  {
    "id": "G-001",
    "name": "Managers",
    "description": "",
    "organization": {
        "id": "ORG-001"
    }
  },
  {
    "id": "G-002",
    "name": "CxO",
    "description": "",
    "organization": null
  },
    .....
]

 

Get group by ID

Get details of a group via group ID.

URL: /group/{id}

HTTP Method: GET

Path Parameter
Parameter Description
id Group ID.
Sample Response
{
  "id": "G-002",
  "name": "CxO",
  "description": "",
  "organization": {
    "id": "ORG-001"
  }
}

 

Unassign user from group

Unassign a Joget user from a group.

URL: /group/unassignUser/{group}/{username}

HTTP Method: DELETE

Path Parameters
Parameter Description
group Group ID.
username Username of Joget user.
Sample Response
{
  "date": "Thu Dec 05 03:29:56 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}

 

Update group

Update the details of a group.

URL: /group

HTTP Method: PUT

Body Parameters
Parameter Description
id Group ID.
name Group name.
description Description of group.
organization  
id ID of the organization that this group belongs to.
Sample Response
{
    "id": "apiTestGroup",
    "name": "API Test Group",
    "description": "This group is updated via API.",
    "organization": {
        "id": "ORG-001"
    }
}
Created by Julieth Last modified by Aadrian on Dec 03, 2024