From 17663a93dc53de821e2f6375bb0f54f4bf323691 Mon Sep 17 00:00:00 2001
From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com>
Date: Mon, 3 Apr 2023 06:45:38 +0530
Subject: [PATCH 1/2] updated the api contracts for users filters api
---
users/README.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 46 insertions(+)
diff --git a/users/README.md b/users/README.md
index 85fe8e66..defacb07 100644
--- a/users/README.md
+++ b/users/README.md
@@ -43,6 +43,7 @@ number and email address.
| [GET /users/:userId/badges](#get-usersidbadges) | Returns badges assigned to the user |
| [POST /users](#post-users) | Creates a new User |
| [PATCH /users/self](#patch-usersself) | Updates data of the User |
+| [GET /users/filter](#get-usersfilter) | Returns user data based on a filter |
## **GET /users**
@@ -260,3 +261,48 @@ Updates data of the User.
- **Code:** 503
- **Content:**
`{ 'statusCode': 503, 'error': 'Service Unavailable', 'message': 'Something went wrong please contact admin' }`
+
+## **GET /users/filter**
+
+Returns users in the system based on the specified filters.
+
+- **Params**
+ None
+- **Query**
+ Required: filterParams=[object] (filterParams is an object containing the filter criteria)
+ Optional:
+ `levelId=[string]` (an array of level IDs to filter users by)
+ Optional:
+ `levelNumber=[number]` (an array of level names to filter users by.)
+ Optional:
+ `levelName=[string]` (an array of level names to filter users by.)
+ Optional:
+ `tagId=[string]` (an array of tag IDs / Skill Ids to filter users by.)
+ Optional:
+ `state=[string]` (an array of user states to filter users by i.e OOO, IDLE, ACTIVE )
+- **Body**
+ None
+- **Headers**
+ Content-Type: application/json
+- **Cookie**
+ rds-session: ``
+- **Success Response:**
+- **Code:** 200
+ - **Content:**
+
+```
+{
+ message: 'Users returned successfully!'
+ users: [
+ {}
+ ]
+ count: 'number'
+}
+```
+
+- **Error Response:**
+ - **Code:** 401
+ - **Content:**
+ `{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }`
+ - **Code:** 500
+ - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'Something went wrong please contact admin.' }`
From c8a420c47f526c79d752752469b475fa56d5a143 Mon Sep 17 00:00:00 2001
From: Randhir Kumar Singh <97341921+heyrandhir@users.noreply.github.com>
Date: Mon, 3 Apr 2023 06:51:21 +0530
Subject: [PATCH 2/2] changed indentation
---
users/README.md | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/users/README.md b/users/README.md
index defacb07..18a77d4b 100644
--- a/users/README.md
+++ b/users/README.md
@@ -305,4 +305,5 @@ Returns users in the system based on the specified filters.
- **Content:**
`{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }`
- **Code:** 500
- - **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'Something went wrong please contact admin.' }`
+ - **Content:**
+ `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'Something went wrong please contact admin.' }`