Post a message with product in a chatroom

POST /chat/chatrooms/{chatroom}/messages-product

Path parameters

  • chatroom integer Required

    The chatroom id

application/json

Body

  • id_ambassador integer Required
  • id_product integer Required

Responses

  • 201 application/json

    Return the created message with products

    Hide response attributes Show response attributes object
    • id_message integer
    • date_insert string(date-time)
    • author object

      Additional properties are allowed.

      Hide author attributes Show author attributes object
      • id_ambassador integer(int32)
      • image string
      • firstname string
      • lastname string
      • username string
      • email string
      • email_tmp string
      • active integer(int32)
      • status integer(int32)
      • online boolean

        true: when last_action_date is less than 5 minutes ago

      • last_action_date string(date-time)
      • customer_id string
      • anonymized boolean
    • content string
    • type_message integer

      0: text, 1: picture, 2: rating, 3: product, 4: connection, 5: request, 6: unavailable, 7: video, 8: email, 9: missed

    • status_moderation integer
    • products array[object]
      Hide products attributes Show products attributes object
      • id_product integer(int32)
      • name string(nullable)
      • type string(nullable)
      • discount_percentage number(float)
      • price_catalog integer(float)
      • reference_unit_price integer(float)
      • sku string(nullable)
      • youtube_id string(nullable)
      • url string(nullable)
      • description string(nullable)
      • images array[object]
        Hide images attributes Show images attributes object
        • id_i18n_content integer
        • lang string

          Values are en_GB, fr_FR, es_ES, or de_DE.

        • content string
      • price number(float)
      • stock integer(float)
      • stock_available number(float)
      • old_image string(nullable)
  • 401 application/json

    Unauthorized.

    Hide response attribute Show response attribute object
    • message string
  • 403

    Forbidden - You don't have permission to access this route

  • 422 application/json

    Unprocessable Content

    Hide response attributes Show response attributes object
    • message string

      Error message.

    • errors object
      Hide errors attributes Show errors attributes object
      • field array[string]

        Error message details.

      • * array[string] Additional properties

        Error message details.

POST /chat/chatrooms/{chatroom}/messages-product
curl \
 --request POST 'https://domain.tld/api/v2/chat/chatrooms/{chatroom}/messages-product' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"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": "2025-05-04T09:42:00Z",
    "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"
    ]
  }
}