Skip to content

Commit 781ff32

Browse files
updated api
1 parent 9de79d2 commit 781ff32

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎docs/API_CONTRACTS.md‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
| POST | [/api/auth/login](#2-login-user) | Log in and receive a token pair |
1818
| POST | [/api/auth/refresh](#3-refresh) | Exchange a refresh token for a new token pair |
1919
| GET | [/api/users/me](#1-user-me) | Get the authenticated user's profile |
20-
| GET | [/api/users/:id](#2-search-user-by-id) | Search users by username or display name |
21-
| GET | [/api/users/search?q=&page=&limit=](#3-search-user-by-username-and-display-name) | Get a public user profile |
20+
| GET | [/api/users/:id](#2-search-user-by-id) | Search users by User id |
21+
| GET | [/api/users/search?q=&page=&limit=](#3-search-user-by-username-and-display-name) | Search user by username and display name |
2222
| GET | [/ws](#1-connect-to-websocket) | WebSocket upgrade endpoint (JWT required) |
2323
| WS | [Client to Server](#2-client-to-server-messages) | Client to Server Websocket |
2424
| WS | [Server to Client](#3-server-to-client-messages) | Server to Client Websocket |
@@ -697,10 +697,10 @@ Conversations is successfully retrieved.
697697
"name": "<username>",
698698
"display_name": "<display Name>",
699699
"last_message": "<content>",
700-
"last_message_time": "<last message time>",
700+
"last_message_time": "<Timestamp",
701701
"sender_id": "<user_id>",
702-
"is_read": (bool)"<read of coresponding user>",
703-
"unread_count": (int)0"<unread_count of corresponding user>"
702+
"is_read": false/true"<read_status>",
703+
"unread_count": 0"<unread_count of corresponding user>"
704704
}
705705
]
706706
}
@@ -782,7 +782,7 @@ Returned when group is successfully created
782782
```
783783

784784
##### `401 Unauthorized`
785-
Returned when access token is expried or incorrect.
785+
Returned when access token is expired or incorrect.
786786
```json
787787
{
788788
"success": false,
@@ -983,7 +983,7 @@ Returned when access token is expired or incorrect
983983

984984
### 6. Leave Group
985985

986-
- **URL:** `/api/messages/groups/{id}/leave`
986+
- **URL:** `/api/groups/{id}/leave`
987987
- **Method:** `POST`
988988
- **Headers:** `Content-Type: application/json`
989989
- **Authentication Required:** `YES`
@@ -1020,14 +1020,14 @@ Returned when access token is expired or incorrect
10201020

10211021
### 7. Update Group Details
10221022

1023-
- **URL:** `/api/messages/groups/{id}/`
1023+
- **URL:** `/api/groups/{id}/`
10241024
- **Method:** `PATCH`
10251025
- **Headers:** `Content-Type: application/json`
10261026
- **Authentication Required:** `YES`
10271027
- **Admin Access Required:** `YES`
10281028
- **curl:** `curl -X PATCH "http://HOST:PORT/api/groups/{id}/" -H "Authorization: Bearer <access_token>" -d '{ "name":"<group_name>" }'`
10291029

1030-
#### Response Body
1030+
#### Request Body
10311031
```json
10321032
{
10331033
"name":"<new_group_name>"
@@ -1070,7 +1070,7 @@ Returned when access token is expired or incorrect
10701070
```
10711071

10721072
### 8. Add Member to group
1073-
- **URL:** `/api/messages/groups/{id}/members`
1073+
- **URL:** `/api/groups/{id}/members`
10741074
- **Method:** `POST`
10751075
- **Headers:** `Content-Type: application/json`
10761076
- **Authentication Required:** `YES`
@@ -1129,7 +1129,7 @@ Returned when access token is expired or incorrect
11291129
```
11301130

11311131
### 9. Remove User from Group
1132-
- **URL:** `/api/messages/groups/{id}/members/{user_id}`
1132+
- **URL:** `/api/groups/{id}/members/{user_id}`
11331133
- **Method:** `DELETE`
11341134
- **Headers:** `Content-Type: application/json`
11351135
- **Authentication Required:** `YES`

0 commit comments

Comments
 (0)