User API

Introduction

The User API allows you to interact with users in Joget's built-in directory manager. 

Get started

How to use it

  • Drag and drop the User API from the Palette to the Canvas.
  • Select the endpoints

List of API Endpoints

Add user

Add a new user account.

URL: /user

HTTP Method: POST

Body Parameters
Parameter Description
id User ID of user.
username

Username of user.

password User's password.
firstName User's first name.
lastName User's last name.
email User's email.
active User's account active status.
timeZone User's time zone.
locale User's locale.
Sample Response
{
  "id": "apiUser",
  "username": "apiUser",
  "firstName": "API",
  "lastName": "User",
  "email": "",
  "active": 1,
  "timeZone": "",
  "locale": ""
}

 

Delete user

Delete a user account.

URL: /user/{username}

HTTP Method: DELETE

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
{
  "date": "Fri Aug 30 00:38:43 SGT 2019",
  "code": "200",
  "message": "Successful operation"
}

 

Find HOD by username

Find the HOD of the department to which the specified user belongs via username.

URL: /user/findHod/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
[
  {
    "id": "clark",
    "username": "clark",
    "firstName": "Clark",
    "lastName": "Kent",
    "email": "",
    "active": 1,
    "timeZone": "",
    "locale": null
  }
]

 

Find subordinates by username

Find all users that report to the specified user via username.

URL: /user/findSubordinate/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
[
  {
    "id": "clark",
    "username": "clark",
    "firstName": "Clark",
    "lastName": "Kent",
    "email": "",
    "active": 1,
    "timeZone": "",
    "locale": null
  },
    .....
]

 

Find user

Get user details of all users by default.

Able to filter or sort the returned results via parameters.

URL: /user/find

HTTP Method: GET

Query String Parameters
Parameter Description
nameFilter Filters the response via user ID.
organizationId Filter users that belong to an organization via organization ID.
departmentId Filter users that belong to a department via department ID.
gradeId Filter users that belong to a grade via grade ID.
groupId Filter users that belong to a group via group ID.
roleId Filter users that have such a role (e.g., role_user OR role_admin).
active

Filter users by account active status. 1 for active, 0 for inactive.

sort

User 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": "admin",
    "username": "admin",
    "firstName": "Admin",
    "lastName": "Admin",
    "email": null,
    "active": 1,
    "timeZone": "0",
    "locale": null
  },
    .....
]

 

Get department HOD

Get user details of the department's HOD via department ID.

URL: /user/findHodByDepartment/{departmentId}

HTTP Method: GET

Path Parameters
Parameter Description
departmentId Department ID.
Sample Response
{
  "id": "terry",
  "username": "terry",
  "firstName": "Terry",
  "lastName": "Berg",
  "email": "",
  "active": 1,
  "timeZone": "",
  "locale": null
}

 

Get employment info

Get employment details of a user via username.

URL: /user/employment/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
{
  "startDate": "Apr 1, 2019",
  "endDate": "Aug 29, 2019",
  "employeeCode": "JOGET-0098-D",
  "gradeId": "G-003",
  "departmentId": "D-005",
  "organizationId": "ORG-001"
}

 

Get roles by username

Get a user's roles (e.g., regular user, Joget administrator) via username.

URL: /user/roles/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
[
  {
    "id": "ROLE_ADMIN",
    "name": "Admin",
    "description": "Administrator"
  },
  {
    "id": "ROLE_SYSADMIN",
    "name": "ROLE_SYSADMIN",
    "description": null
  }
]

 

Get user by username

Get the user details via username.

URL: /user/{username}

HTTP Method: GET

Path Parameters
Parameter Description
username Username of a Joget user.
Sample Response
{
  "id": "cat",
  "username": "cat",
  "firstName": "Cat",
  "lastName": "Grant",
  "email": "",
  "active": 1,
  "timeZone": "8",
  "locale": null
}

 

Update user

Update the user details of a user.

URL: /user

HTTP Method: PUT

Body Parameters
The user ID specified must be of an existing user to update its details successfully.
Parameter Description
id User ID of user.
username Username of user.
password User's password.
firstName User's first name.
lastName User's last name.
email User's email.
active User's account active status.
timeZone User's time zone.
locale User's locale.

 

Sample Response
{
  "id": "apiUser",
  "username": "apiUser",
  "firstName": "API",
  "lastName": "User Pro",
  "email": "apiUserPro@email.com",
  "active": 1,
  "timeZone": "8",
  "locale": ""
}
Created by Julieth Last modified by Aadrian on Dec 03, 2024