Post a message with product in a chatroom
Path parameters
-
The chatroom id
POST /chat/chatrooms/{chatroom}/messages-product
curl \
-X POST https://domain.tld/api/v2/chat/chatrooms/{chatroom}/messages-product \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"id_ambassador":5,"id_product":2}'
Request examples
{
"id_ambassador": 5,
"id_product": 2
}
Response examples (201)
{
"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,
"products": [
{
"id_product": 42,
"name": "string",
"type": "string",
"discount_percentage": 42.0,
"price_catalog": 42,
"reference_unit_price": 42,
"sku": "string",
"youtube_id": "string",
"url": "string",
"description": "string",
"images": [
{
"id_i18n_content": 42,
"lang": "en_GB",
"content": "Hello"
}
],
"price": 42.0,
"stock": 42,
"stock_available": 42.0,
"old_image": "string"
}
]
}
Response examples (401)
{
"message": "Unauthorized."
}
Response examples (422)
{
"message": "field is required! (and 3 more error)",
"errors": {
"field": [
"Error message details here"
],
"additionalProperty1": [
"Error message details here"
],
"additionalProperty2": [
"Error message details here"
]
}
}