Consult conversations¶
Retrieve conversations¶
This endpoint allows the seller to retrieve a collection of conversations opened by customers using filters as a reference.
Scope required
Value | Description |
---|---|
services:conversations-seller:read |
Enables use of the read APIs. |
URL parameters
Field | Type | Description | Required |
---|---|---|---|
_limit | Integer | Determines the number of records to be returned. Default value 10. | Yes |
_offset | Integer | Reference record position, from which the next N records will be returned. Default value 0. | No |
status | String | Message status, can be the following values:
|
No |
from_user_ref_key | String | Identifier of the customer who created the conversation. | No |
last_interaction_at_start | String (datetime ISO 8601) | Filters interactions from the date entered (e.g.: "2023-06-27T12:15:37.729Z") | No |
last_interaction_at_end | String (datetime ISO 8601) | Filters interactions up to the date entered (e.g. "2023-06-27T12:15:37.729Z") | No |
Request:
curl -X 'GET' \
'https://services.magalu.com/v0/conversations?status=WAITING_RESPONSE&_offset=150&_limit=20' \\
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
Response:
Domain: PaginatedResponse[Conversation]:¶
{
"meta": {
"page": {
"limit": 20,
"offset": 150,
"max_limit": 100
},
"links": {
"previous": "?_offset=130&_limit=20",
"next": "?_offset=170&_limit=20",
"self": "?_offset=150&_limit=20"
}
},
"results": [
{
"id": "6628da4c11696b6967daf96c",
"display_name": "Conversation Name",
"owner": {
"name": "Z Store",
"ref_key": "zstore"
},
"from_user": {
"id": "6628d7a3c01daebde56f5598",
"full_name": "John Doe",
"full_name_normalized": "johndoe",
"external_id": "e8528120-fc36-43e9-bd01-fd453d938da7",
"type": "CUSTOMER"
},
"to_user": {
"id": "6628d7a3c01daebde56f5599",
"full_name": "Z Store",
"full_name_normalized": "zstore",
"external_id": "zstore",
"type": "SELLER"
},
"unread_from_count": 6,
"unread_to_count": 0,
"last_interaction_at": "2023-11-01T14:09:51.600Z",
"status": "OPENED",
"last_message": {
"id": "6628da6211696b6967daf96f",
"from_user": {
"full_name": "John Doe",
"full_name_normalized": "johndoe",
"external_id": "e8528120-fc36-43e9-bd01-fd453d938da7",
"type": "CUSTOMER"
},
"content": "Hello world",
"when_at": "2023-11-01T13:36:15.935Z"
},
"is_new_to": false,
"tags": [
{
"name": "productId",
"value": "kb3cghh1ge"
},
{
"name": "productTitle",
"value": "Guarda Roupa Casal Grande 6 Portas 4 Gavetas Marrom Next"
},
{
"name": "productImage",
"value": "https://a-static.mlcdn.com.br/{w}x{h}/guarda-roupa-casal-grande-6-portas-4-gavetas-marrom-next-caemmun/caemmun/7899630657530/85f19946fa851fda2a2fee973273b940.jpeg"
},
{
"name": "productUrl",
"value": "https://www.magazineluiza.com.br/guarda-roupa-casal-grande-6-portas-4-gavetas-marrom-next-caemmun/p/kb3cghh1ge/mo/guro/"
}
],
"created_at": "2023-10-24T16:58:02.312Z",
"updated_at": "2023-11-23T16:57:10.353Z"
}
]
}
Return codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |
Recover conversation by ID¶
This endpoint allows the seller to retrieve a conversation by ID
Scope required
Value | Description |
---|---|
services:conversations-seller:read |
Enables use of the read APIs. |
URL parameters
Field | Type | Description | Required |
---|---|---|---|
conversation_id | String | Conversation identifier | Yes |
Request:
curl -X 'GET' \
'https://services.magalu.com/v0/conversations/{conversation_id}' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
Response:
Domain: Conversation:¶
{
"id": "6628da4c11696b6967daf96c",
"display_name": "Conversation Name",
"owner": {
"name": "Z Store",
"ref_key": "zstore"
},
"from_user": {
"id": "6628d7a3c01daebde56f5598",
"full_name": "John Doe",
"full_name_normalized": "johndoe",
"external_id": "e8528120-fc36-43e9-bd01-fd453d938da7",
"type": "CUSTOMER"
},
"to_user": {
"id": "6628d7a3c01daebde56f5599",
"full_name": "Z Store",
"full_name_normalized": "zstore",
"external_id": "zstore",
"type": "SELLER"
},
"unread_from_count": 6,
"unread_to_count": 0,
"last_interaction_at": "2023-11-01T14:09:51.600Z",
"status": "OPENED",
"last_message": {
"id": "6628da6211696b6967daf96f",
"from_user": {
"full_name": "John Doe",
"full_name_normalized": "johndoe",
"external_id": "e8528120-fc36-43e9-bd01-fd453d938da7",
"type": "CUSTOMER"
},
"content": "Hello world",
"when_at": "2023-11-01T13:36:15.935Z"
},
"is_new_to": false,
"tags": [
{
"name": "productId",
"value": "kb3cghh1ge"
},
{
"name": "productTitle",
"value": "Guarda Roupa Casal Grande 6 Portas 4 Gavetas Marrom Next"
},
{
"name": "productImage",
"value": "https://a-static.mlcdn.com.br/{w}x{h}/guarda-roupa-casal-grande-6-portas-4-gavetas-marrom-next-caemmun/caemmun/7899630657530/85f19946fa851fda2a2fee973273b940.jpeg"
},
{
"name": "productUrl",
"value": "https://www.magazineluiza.com.br/guarda-roupa-casal-grande-6-portas-4-gavetas-marrom-next-caemmun/p/kb3cghh1ge/mo/guro/"
}
],
"created_at": "2023-10-24T16:58:02.312Z",
"updated_at": "2023-11-23T16:57:10.353Z"
}
Return codes
Code | Description |
---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
500 | Internal Server Error |