# M01 - List messages linked to orders and offers (deprecated)

Deprecated endpointThis API is going to be permanently removed **on April 5 2027**, please use M10 and M11 instead.
Call FrequencyRecommended usage: Synchronous only - at each message list displayMaximum usage: Synchronous only - at each message list displayPaginationThis resource supports offset pagination (see documentation)Sort fieldssort field can have the following values:dateCreated (Default) - Sort by creation date (desc by default)

Endpoint: GET /api/messages
Security: Front-Bearer-Token, OAuth-2

## Security:

  - `Front-Bearer-Token` (unknown)
    http bearer JWT

  - `OAuth-2` (unknown)
    oauth2

## Query parameters:

  - `user_type` (string)
    Returns only messages concerned by one type of user (i.e. only customers' messages).<ul><li><code>ALL</code>: Returns all messages from all users (parameter <code>received</code> will be ignored)</li><li><code>CUSTOMER</code>: Returns all messages from or to a customer (parameter <code>received</code> concerns the customer)</li><li><code>SHOP</code>: Returns all messages from or to a shop (parameter <code>received</code> concerns the shop)</li><li><code>OPERATOR</code>: Returns all messages from or to an operator (parameter <code>received</code> concerns the operator)</li></ul>

  - `customer_id` (string)
    Returns messages concerned by this <code>customer_id</code>

  - `shop_id` (integer)
    Returns messages concerned by this <code>shop_id</code>

  - `received` (string)
    Do not use when <code>user_type</code> is <code>ALL</code>.<ul><li> If <code>TRUE</code>: returns only messages received from <code>user_type</code>.</li><li> If <code>FALSE</code>: returns only messages sent to <code>user_type</code>.</li><li> If <code>ALL</code> and <code>user_type</code> is <code>OPERATOR</code>, returns all messages, even direct messages between customer and shop.</li></ul>

  - `order_id` (string)
    Order identifier

  - `offer_id` (integer)
    Offer identifier

  - `start_date` (string)
    Start creation date for filtering

  - `end_date` (string)
    End creation date for filtering

  - `paginate` (boolean)
    Control the pagination usage

## Response 200:

  - `200` (unknown)
    OK

## Response 200 fields (application/json):

  - `messages` (array, required)
    List of messages

  - `messages.archived` (boolean)
    Will be removed in next version

  - `messages.body` (string, required)
    Message body

  - `messages.commercial_id` (string, required)
    Order commercial ID. Used only when retrieving messages of an order.

  - `messages.date_created` (string, required)
    Message creation date

  - `messages.documents` (array)
    Documents list

  - `messages.documents.date_uploaded` (string)
    Document uploaded date

  - `messages.documents.file_name` (string, required)
    Document file name

  - `messages.documents.file_size` (integer)
    File size

  - `messages.documents.id` (integer, required)
    Document identifier

  - `messages.documents.type` (string, required)
    Document type code

  - `messages.from_id` (string, required)
    Sender user identifier

  - `messages.from_name` (string, required)
    Sender user name

  - `messages.from_type` (string, required)
    Sender user type
Enum: `"OPERATOR"`, `"SHOP"`, `"CUSTOMER"`

  - `messages.id` (integer, required)
    Message identifier

  - `messages.offer_id` (integer)
    Identifier of offer : this value is not fixed and can changed after a long period

  - `messages.order_id` (string)
    Order ID. Used only when retrieving messages of an order.

  - `messages.read` (boolean)
    Will be removed in next version

  - `messages.subject` (string, required)
    Message subject

  - `messages.to_customer_archived` (boolean, required)
    Will be removed in next version

  - `messages.to_customer_id` (string, required)
    Recipient customer ID

  - `messages.to_customer_name` (string, required)
    Recipient customer name

  - `messages.to_operator` (boolean, required)
    Indicates the message sent to operator. Used only when retrieving messages of an order.

  - `messages.to_operator_archived` (boolean, required)
    Will be removed in next version

  - `messages.to_shop_archived` (boolean, required)
    Will be removed in next version

  - `messages.to_shop_id` (integer, required)
    Recipient shop ID

  - `messages.to_shop_name` (string, required)
    Recipient shop name

  - `messages.visible` (boolean)
    States whether or not the message is visible (public). Only relevant for messages on offers and always null for messages on orders.

  - `total_count` (integer, required)
    Messages total count

## Response 200 examples:

  - `Example with business values (application/json)` (unknown)

  - `Complete example with value types (application/json)` (unknown)

