Skip to content

Commit 17663a9

Browse files
committed
updated the api contracts for users filters api
1 parent cb4980e commit 17663a9

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

users/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ number and email address.
4343
| [GET /users/:userId/badges](#get-usersidbadges) | Returns badges assigned to the user |
4444
| [POST /users](#post-users) | Creates a new User |
4545
| [PATCH /users/self](#patch-usersself) | Updates data of the User |
46+
| [GET /users/filter](#get-usersfilter) | Returns user data based on a filter |
4647

4748
## **GET /users**
4849

@@ -260,3 +261,48 @@ Updates data of the User.
260261
- **Code:** 503
261262
- **Content:**
262263
`{ 'statusCode': 503, 'error': 'Service Unavailable', 'message': 'Something went wrong please contact admin' }`
264+
265+
## **GET /users/filter**
266+
267+
Returns users in the system based on the specified filters.
268+
269+
- **Params**
270+
None
271+
- **Query**
272+
Required: filterParams=[object] (filterParams is an object containing the filter criteria) <br>
273+
Optional:
274+
`levelId=[string]` (an array of level IDs to filter users by) <br>
275+
Optional:
276+
`levelNumber=[number]` (an array of level names to filter users by.) <br>
277+
Optional:
278+
`levelName=[string]` (an array of level names to filter users by.) <br>
279+
Optional:
280+
`tagId=[string]` (an array of tag IDs / Skill Ids to filter users by.) <br>
281+
Optional:
282+
`state=[string]` (an array of user states to filter users by i.e OOO, IDLE, ACTIVE ) <br>
283+
- **Body**
284+
None
285+
- **Headers**
286+
Content-Type: application/json
287+
- **Cookie**
288+
rds-session: `<JWT>`
289+
- **Success Response:**
290+
- **Code:** 200
291+
- **Content:**
292+
293+
```
294+
{
295+
message: 'Users returned successfully!'
296+
users: [
297+
{<user_object>}
298+
]
299+
count: 'number'
300+
}
301+
```
302+
303+
- **Error Response:**
304+
- **Code:** 401
305+
- **Content:**
306+
`{ 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }`
307+
- **Code:** 500
308+
- **Content:** `{ 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'Something went wrong please contact admin.' }`

0 commit comments

Comments
 (0)