# Conversation
# Get Conversations
# Resource URL
https://humtog.com/api/conversations
# Resource Method
GET
# Params
| Name | Required | Type | Description |
|---|---|---|---|
with_last_message | No | boolean | Use to show last message |
with_contact | No | boolean | Use to show only contacts |
# Example Response
{
"data": [
{
"id": 1,
"user_id": 2,
"created_at": "2020-05-02 10:12:43",
"last_message_id": 5,
"last_message": {
"id": 5,
"user_id": 1,
"created_at": "2020-05-21 14:50:30",
"read_at": "2020-05-21 14:50:45",
"content": {
"text": "textMessage"
},
"author": {
"id": 1,
"username": "userName",
"name": "fullName",
"bio": null,
"avatar": "/imgs/default-avatar.png",
"email": "email@example.com",
"verified_email": true,
"cover_color": "Dark",
"created_at": "2020-04-29 09:21:42",
"info": {
"location": "Country",
"twitter": null,
"website": null
}
}
},
"contact": {
"id": 2,
"username": "contactUser",
"name": "contactName",
"bio": null,
"avatar": "/imgs/default-avatar.png",
"verified_email": false,
"cover_color": null,
"created_at": null,
"info": {
"location": null,
"twitter": null,
"website": null
}
}
}
]
}
# Search Conversations
# Resource URL
https://humtog.com/api/conversations/search
# Resource Method
POST
# Params
| Name | Required | Type | Description |
|---|---|---|---|
keyword | Yes | string | Used to search conversation by username like @userName |
# Example Response
{
"data": [
{
"id":4,
"username":"userName",
"name":"fullName",
"bio":null,
"avatar":"\/imgs\/default-avatar.png",
"verified_email":false,
"cover_color":"Dark",
"created_at":"2020-05-20 12:48:49",
"info":
{
"location":null,
"twitter":null,
"website":null
}
},
...
]
}
# Mark Conversation as read
This will broadcast seen event
# Resource URL
https://humtog.com/api/conversations/:user_id/read
# Resource Method
GET
# Example Response
{
"message": "\"seen\" event broadcasted successfully."
}
# Delete Conversations
# Resource URL
https://humtog.com/api/api/conversations/:user_id
# Resource Method
DELETE
# Example Response
{
"message": "left conversation successfully"
}
← Notification Message →