GET
/api/v1/customer/messages
This API method will return all of the message groups for the current customer, with the details of the last active member & last active chat.
You can also use this API for polling results by passing in the last check_time using the max time returned in your previous request.
Request Parameters
Parameter | Value / Type | Required |
|---|---|---|
page | INTEGER (Default: 1) | false |
per_page | INTEGER (Default: 50) | false |
check_time | DATE (Y-m-d H:i:s) | false |
Sample Response
{
"status": true,
"items": [
{
"group_id": "vdoV8pgXe6Dz0JqAWwRK",
"group_image": null,
"group_name": "Steve Phillips, John Doe, 1 Blocked User",
"last_message": "Hey man! How ya been?",
"last_message_time": "2018-08-07 16:01:43",
"initial_customer_id": "LZWBJx0PmYkEwjGdr2vO",
"initial_customer_name": "Steve Phillips",
"initial_customer_avatar": "http:\/\/controlcenter.ftx\/customer\/images\/default-avatars\/6?v=1531318162",
"last_customer": "LZWBJx0PmYkEwjGdr2vO",
"last_customer_name": "Steve Phillips",
"last_customer_avatar": "http:\/\/controlcenter.ftx\/customer\/images\/default-avatars\/6?v=1531318162",
"read_status": 0,
"notifications_disabled": 1,
"group_members": [
{
"id": "LZWBJx0PmYkEwjGdr2vO",
"name": "Steve Phillips",
"avatar": "http:\/\/controlcenter.ftx\/customer\/images\/default-avatars\/6?v=1531318162",
"customer_description": "",
"friend_status": -1,
"total_balance": 2000,
"is_blocked": false
},
{
"id": "nK8oWGj0zxqELP1A53ak",
"name": "John Murdock",
"avatar": "http:\/\/controlcenter.ftx\/customer\/images\/default-avatars\/4?v=1513880339",
"customer_description": "",
"friend_status": 1,
"total_balance": 100,
"is_blocked": true
},
{
"id": "nK8oWGj0zxqELP1A53ak",
"name": "John Murdock",
"avatar": "http:\/\/controlcenter.ftx\/customer\/images\/default-avatars\/4?v=1513880339",
"customer_description": "",
"friend_status": 1,
"total_balance": 100,
"is_blocked": false
}
]
}
]
}{
"status": false,
"errorCode": "NO_ITEMS",
"message": "There are no messages available"
}