> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Chat Messages

> Get all or some of the messages in a chat session

NsApiSlow threshold: 5000 ms.



## OpenAPI

````yaml /openapi/agent/openapi-v3-ChatAgent.json post /api/v1/Agents/Chat/GetChatMessages
openapi: 3.0.0
info:
  version: v1-Agents
  title: SuperOffice Agent API v1
  description: SuperOffice Agent API - ChatAgent
  contact:
    name: SuperOffice DevNet
    url: https://docs.superoffice.com/en/api/index.html
    email: sdk@superoffice.com
servers:
  - url: http://localhost:56350
  - url: https://localhost:56350
security: []
tags: []
externalDocs:
  description: >-
    The SuperOffice DevNet Community has more documentation, examples, and
    discussion forums.
  url: https://community.superoffice.com/en/developer/
paths:
  /api/v1/Agents/Chat/GetChatMessages:
    post:
      tags:
        - Chat_Agent
      summary: Get Chat Messages
      description: |-
        Get all or some of the messages in a chat session

        NsApiSlow threshold: 5000 ms.
      operationId: v1ChatAgent_GetChatMessages
      parameters:
        - name: $select
          in: query
          description: >-
            Optional comma separated list of properties to include in the
            result. Other fields are then nulled out to reduce payload size:
            "Name,department,category". Default = show all fields.
          required: false
          schema:
            type: string
        - name: Accept-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code.
          required: false
          schema:
            type: string
        - name: SO-Language
          in: header
          description: >-
            Convert string references and multi-language values into a specified
            language (iso2) code. Overrides Accept-Language value.
          required: false
          schema:
            type: string
        - name: SO-Culture
          in: header
          description: >-
            Number, date formatting in a specified culture (iso2 language) code.
            Partially overrides SO-Language/Accept-Language value. Ignored if no
            Language set.
          required: false
          schema:
            type: string
        - name: SO-TimeZone
          in: header
          description: >-
            Specify the timezone code that you would like date/time responses
            converted to.
          required: false
          schema:
            type: string
        - name: SO-AppToken
          in: header
          description: >-
            The application token that identifies the partner app. Used when
            calling Online WebAPI from a server.
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          text/json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          application/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          text/xml:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          application/x-www-form-urlencoded:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          application/json-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
          application/merge-patch+json:
            schema:
              $ref: >-
                #/components/schemas/SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest
        description: ChatSessionId, After
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            text/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            text/xml:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/json-patch+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
            application/merge-patch+json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/SuperOffice.CRM.Services.ChatMessage'
      security:
        - SuperOffice_Password: []
          SuperId_Authentication: []
components:
  schemas:
    SuperOffice.WebApi.v1.Carriers.ChatCarriers.GetChatMessagesRequest:
      description: 'GetChatMessages: Get all or some of the messages in a chat session'
      type: object
      properties:
        ChatSessionId:
          format: int32
          type: integer
        After:
          format: int32
          type: integer
    SuperOffice.CRM.Services.ChatMessage:
      description: "A message in a chat session\r\n<para />\r\nCarrier object for ChatMessage.\r\nServices for the ChatMessage Carrier is available from the <see cref=\"T:SuperOffice.CRM.Services.IChatAgent\">Chat Agent</see>."
      type: object
      properties:
        ChatMessageId:
          format: int32
          description: The primary key (auto-incremented)
          type: integer
        ChatSessionId:
          format: int32
          description: The reference to the associated chat session.
          type: integer
        Type:
          description: The type of the message.
          enum:
            - Invalid
            - ToCustomer
            - ToUser
            - Special
          type: string
        Message:
          description: The message.
          type: string
        Author:
          description: The author of the message.
          type: string
        ReadByCustomer:
          format: int32
          description: Whether the message has been read by the customer or not.
          type: integer
        SpecialType:
          description: >-
            Enum indicating if it is a special message, such as an URL
            redirection, etc.
          enum:
            - None
            - Welcome
            - Url
            - Block
            - NewSession
            - TransferedSession
            - Error
            - SessionDeleted
            - FaqSuccessQuestion
            - ClosedByUser
            - ClosedByCustomer
            - ClosedByIdle
            - TransferRejected
            - ReopenedByCustomer
            - ClickedOption
            - BotMessage
            - Options
            - IllegalFileType
          type: string
        SpecialParam:
          description: Special parameter for the special_type.
          type: string
        WhenPosted:
          format: date-time
          description: When the message was posted (UTC timestamp).
          type: string

````

## Related topics

- [Get Chat Messages](/en/api/reference/restful/rest/chatsession/get-chat-messages.md)
- [NSChatMessage](/en/automation/crmscript/reference/CRMScript.NetServer.NSChatMessage.md)
- [NSChatAgent](/en/automation/crmscript/reference/CRMScript.NetServer.NSChatAgent.md)
- [SuperOffice.WebApi.Data.Chat GetChatMessagesRequest](/en/api/reference/webapi/SuperOffice.WebApi.Data.Chat_GetChatMessagesRequest.md)
- [SuperOffice.WebApi.Agents.ChatAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ChatAgent.md)
- [SuperOffice.WebApi.Agents.IChatAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IChatAgent.md)
