Get all chatrooms of an ambassador
Get all chatrooms of an ambassador and of his guest accounts
Headers
-
The id of the target brand
Path parameters
-
The ambassador id
Query parameters
-
sort string
Sort chatrooms by one of the following fields
Value is
last_action_date
. -
Retrieve chatrooms with last action date before a date
-
filter[archived] boolean
Retrieve archived chatrooms
-
filter[commented] string
Retrieve commented chatrooms
Values are
commented
ornot_commented
. -
filter[flag] integer
Retrieve flagged chatrooms
Values are
1
or2
. -
filter[type_chatroom] string
Retrieve chatrooms by type
Values are
0
or7
.
GET /chat/ambassadors/{ambassador}/chatrooms
curl \
-X GET https://domain.tld/api/v2/chat/ambassadors/{ambassador}/chatrooms \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "X-Popsell-Brand: 42"
Response examples (200)
{
"current_page": 42,
"data": [
{
"id_chatroom": 8,
"ambassadors": [
{
"id_ambassador": 42,
"image": "string",
"firstname": "string",
"lastname": "string",
"username": "string",
"email": "string",
"email_tmp": "string",
"active": 42,
"status": 42,
"online": true,
"last_action_date": "2024-05-04T09:42:00+00:00",
"customer_id": "string",
"anonymized": true,
"chatroom_pivot_data": [
{
"id_chatroom": 42,
"id_ambassador": 42,
"last_read_message": 42,
"is_blocked": true,
"archived": true
}
]
}
],
"date_insert": "2023-10-06T13:41:09.123000Z",
"last_message_date": "2023-10-06T13:41:09.123000Z",
"type_chatroom": 0,
"type_discussion": 2,
"source": 2,
"established_dialogue": "2023-10-06 13:41:09.123",
"last_rating": {
"value": 5,
"comment": "Great ambassador"
},
"last_summary": {
"date_insert": "string",
"summary": "string",
"anomaly": 42,
"topic": 42
},
"last_message": {
"id_message": 16,
"date_insert": "2023-10-09T12:12:40.220000Z",
"author": {
"id_ambassador": 42,
"image": "string",
"firstname": "string",
"lastname": "string",
"username": "string",
"email": "string",
"email_tmp": "string",
"active": 42,
"status": 42,
"online": true,
"last_action_date": "2024-05-04T09:42:00+00:00",
"customer_id": "string",
"anonymized": true
},
"content": "super",
"type_message": 2,
"status_moderation": 0
}
}
],
"first_page_url": "string",
"from": 42,
"last_page": 42,
"last_page_url": "string",
"links": [
{
"url": "string",
"label": "string",
"active": true
}
],
"next_page_url": "string",
"path": "string",
"per_page": 42,
"prev_page_url": "string",
"to": 42,
"total": 42
}
Response examples (401)
{
"message": "Unauthorized."
}