Reply to messages¶
Reply messages¶
This endpoint allows a message to be inserted into the referenced conversation.
Scope required
Value | Description |
---|---|
services:conversations-seller:write |
Allows use of the write/update APIs. |
Parameters of the call
Field | Type | Description | Required |
---|---|---|---|
id | String | Question identification key | Yes |
content | String | Message text | Yes |
external_id | String | Identifier for the message from the external system that is responding. If not filled in, a random value will be used. | No |
owner.name | String | Name of the author responsible for the response. | Yes |
owner.external_id | String | Identifier in the external system (seller's ERP) for the author of the response. | Yes |
Request:
curl -X 'POST' \
'https://services.magalu.com/v0/conversations/{conversation_id}/messages' \
-H 'accept: application/json' \
-H 'Authorization: Bearer <Access Token>' \
-H 'Content-Type: application/json' \
-d '{
"content": "Temos em três cores: azul, amarelo e vermelho.",
"external_id": "resposta-01",
"owner": {
"name": "Joseph Climber",
"external_id": "j.climber"
}
}'
Response:
Domain: MinimalMessage:¶
{
"id": "6628da6211696b6967daf96a",
"content": "Temos em três cores: azul, amarelo e vermelho.",
"external_id": "resposta-01",
"from_user": {
"full_name": "Z Store",
"full_name_normalized": "zstore",
"external_id": "zstore",
"type": "SELLER",
"owner": {
"name": "Joseph Climber",
"external_id": "j.climber"
}
}
}
Return Codes
Code | Description |
---|---|
201 | Created |
400 | Bad Request |
401 | Unauthorized |
404 | Not Found |
500 | Internal Server Error |