logo

API Docs

    Users

users

Users

The user API for managing and importing users from other existing systems is a feature that allows users to manage and import user accounts from other systems into the lock management system. This feature can be accessed through a web portal or mobile app, and allows users to manage and import user accounts from other systems such as Active Directory, LDAP, or other user management platforms.

The User API allows the administrator to import user accounts from other systems, including information such as the user's name, email address, and any other relevant information. This eliminates the need to manually create user accounts one by one and ensures that the user management system is always up-to-date with the most current user information.

The User API also allows the administrator to manage user accounts within the lock management system. This includes the ability to add, edit, and delete users, as well as assign and revoke access to specific locks or groups of locks. The administrator can also assign roles and permissions to users, such as the ability to manage other users or access specific features within the lock management system.

Overall, the User API for managing and importing users from other existing systems is a powerful tool that streamlines user management and ensures that the lock management system is always up-to-date with the most current user information, providing an extra layer of security for the lock management system.


GET

User

{{host}}/api/users?pagenumber=1&limit=10

Description:

This endpoint retrieves a list of users in the system.

Query Parameters:

  • pagenumber: The page number of the results (required)
  • limit: The number of results per page (required)

Response:

Copy

{ "status": 1, "msg": "", "totalPage": 1, "currentPage": "1", "list": [ { "isAdmin": false, "user_id": 3, "employee_id": "004", "department": "R&D", "firstname": "JD", "lastname": "JD", "emailid": "support@arantec.app", "isActive": true, "created_date": "2023-01-23 13:49:56" }, { "isAdmin": true, "user_id": 1, "employee_id": "admin", "department": "Administration", "firstname": "admin", "lastname": "", "emailid": "", "isActive": true, "created_date": "2022-12-29 12:54:25" } ] }
  • status: A status code indicating the success or failure of the request. 1 indicates success, and 0 indicates failure.
  • msg: A message indicating the result of the request.
  • totalPage: The total number of pages of the results
  • currentPage: The current page of the results
  • list: An array of user objects
  • isAdmin : A boolean value indicating if the user is admin or not
  • user_id: The unique ID of the user
  • employee_id: The ID of the user
  • department: The department the user belongs to.
  • firstname: The first name of the user
  • lastname: The last name of the user
  • emailid: The email address of the user
  • isActive : A boolean value indicating if the user is active or not
  • created_date: The date when the user created

Errors:

  • If any of the required parameters are missing, the response will be a status of 0 and a message indicating the missing field(s).
  • If there are no users in the system, the response will be a status of 1 and an empty list array.


POST

Create User

{{host}}/api/user

Description:

This endpoint creates a new user in the system.

Body Parameters:

  • id: The ID of the user (required)
  • firstname: The first name of the user (required)
  • lastname: The last name of the user (required)
  • emailid: The email address of the user (required)
  • department: The department the user belongs to

Response:

Copy

{ "status": 1, "msg": "User Has been Created" }
  • status: A status code indicating the success or failure of the request. 1 indicates success, and 0 indicates failure.
  • msg: A message indicating the result of the request.


PUT

Edit User

{{host}}/api/user

Description:

This endpoint allows you to update an existing user in the system.

Body (Raw JSON):

Copy

{ "user_id":1, "id":"admin", "firstname": "AK", "lastname": "", "emailid": "xx@gmail.com", "department":"" }

Parameters:

  • user_id: The unique identifier for the user. (required)
  • id: The employee id of the user. (required)
  • firstname: The first name of the user.
  • lastname: The last name of the user.
  • emailid: The email address of the user.
  • department: The department the user belongs to.

Response:

Copy

{ "status": 1, "msg": "User Update Success", "user": { "isAdmin": true, "user_id": 1, "employee_id": "admin", "department": "", "firstname": "AK", "lastname": "", "emailid": "dinesh@arantec.in", "isActive": true, "created_date": "2022-12-26 12:47:09" } }
  • status: A status code indicating the success or failure of the request. 1 indicates success, and 0 indicates failure.
  • msg: A message indicating the result of the request.
  • user: An object representing the updated user. It includes the following fields:
    • isAdmin: A boolean indicating whether the user is an admin.
    • user_id: The unique identifier for the user.
    • employee_id: The employee id of the user.
    • department: The department the user belongs to.
    • firstname: The first name of the user.
    • lastname: The last name of the user.
    • emailid: The email address of the user.
    • isActive: A boolean indicating whether the user is active.
    • created_date: The date and time the user was created.


DELETE

Delete User

{{host}}/api/user

Description:

This endpoint allows you to delete an existing user in the system.

Body (Raw JSON):

Copy

{ "user_id":1, }

Parameters:

  • user_id: The unique identifier for the user. (required)

Response:

Copy

{ "status": 1, "msg": "User Deleted Successfully" }
  • status: A status code indicating the success or failure of the request. 1 indicates success, and 0 indicates failure.
  • msg: A message indicating the result of the request.