Base url: https://social-chat.onrender.com
verb
: POST
URL : https://social-chat.onrender.com/chat
To create group chat send isGroupChat: true
In membersId array you have to send userId of members
curl --location '<https://social-chat.onrender.com/chat>' \\
--header 'Content-Type: application/json' \\
--data '{
"chatName":"Jhon stream",
"isGroupChat":false,
"membersId":[
"13b82817-2dd5-4053-8e33-1e1361eed050",
"3fc8076e-56f7-47ea-944b-c2d67063c1aa"
]
}'
Request Body
{
"chatName":"Illusion Frontend",
"isGroupChat":false,
"membersId":[
"13b82817-2dd5-4053-8e33-1e1361eed050",
"3fc8076e-56f7-47ea-944b-c2d67063c1aa"
]
}
Response Body
{
"statusCode": 201,
"message": "Chat created successfully",
"data": {
"id": "bb5822a1-34c7-4ca7-8309-4f2a3a7ef140",
"chatName": "Jhon stream",
"isGroupChat": false,
"members": [
{
"id": "3fc8076e-56f7-47ea-944b-c2d67063c1aa",
"firstName": "Amarendra",
"lastName": "Kumar",
"phone": "7479464719",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-14T17:34:43.906335"
},
{
"id": "13b82817-2dd5-4053-8e33-1e1361eed050",
"firstName": "Jhon",
"lastName": "Doe",
"phone": "2222",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-16T21:54:25.123898"
}
],
"membersId": [],
"lastMessage": {
"id": "63c40041-8736-456b-af53-c56729aacd00",
"sender": {
"id": "13b82817-2dd5-4053-8e33-1e1361eed050",
"firstName": "Jhon",
"lastName": "Doe",
"phone": "2222",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-16T21:54:25.123898"
},
"senderId": null,
"chatId": null,
"message": "How are buddy",
"createdAt": "2023-05-16T21:57:19.017199"
},
"createdAt": "2023-05-16T21:55:13.747409"
}
}
Chat By Id
verb
: GET
URL : https://social-chat.onrender.com/chat/{chatId}
curl --location '<https://social-chat.onrender.com/chat/bb5822a1-34c7-4ca7-8309-4f2a3a7ef140>' \\
--data ''
Response Body
{
"statusCode": 200,
"message": "Chat by id successfully",
"data": {
"id": "bb5822a1-34c7-4ca7-8309-4f2a3a7ef140",
"chatName": "Jhon stream",
"isGroupChat": false,
"members": [
{
"id": "3fc8076e-56f7-47ea-944b-c2d67063c1aa",
"firstName": "Amarendra",
"lastName": "Kumar",
"phone": "7479464719",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-14T17:34:43.906335"
},
{
"id": "13b82817-2dd5-4053-8e33-1e1361eed050",
"firstName": "Jhon",
"lastName": "Doe",
"phone": "2222",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-16T21:54:25.123898"
}
],
"membersId": [],
"lastMessage": {
"id": "63c40041-8736-456b-af53-c56729aacd00",
"sender": {
"id": "13b82817-2dd5-4053-8e33-1e1361eed050",
"firstName": "Jhon",
"lastName": "Doe",
"phone": "2222",
"email": "[email protected]",
"password": "ykdfsh@raj",
"avatarUrl": "<https://icon-library.com/images/anonymous-avatar-icon/anonymous-avatar-icon-25.jpg>",
"createdAt": "2023-05-16T21:54:25.123898"
},
"senderId": null,
"chatId": null,
"message": "How are buddy",
"createdAt": "2023-05-16T21:57:19.017199"
},
"createdAt": "2023-05-16T21:55:13.747409"
}
}