# Post Send message

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v1/chat/message:
    post:
      summary: Post Send message
      deprecated: false
      description: |
        ส่ง message ใน chat ตาม roomid
      tags:
        - Venio/Chat
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: false
          example: application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                roomId:
                  type: string
                  description: ไอดีของห้องแชทที่ต้องการส่งข้อความ
                content:
                  type: string
                  description: เนื้อหาของข้อความที่ต้องการส่ง
                type:
                  type: string
                  description: |-
                    ประเภทของข้อความ
                    - message
                platform:
                  type: string
                  description: |-
                    แพลตฟอร์มที่ใช้
                    - lazada
                    - tiktok
                    - line
                    - facebook
                    - ig
                    - shopee (ยังไม่มี chat สำหรับ shopee ในระบบตอนนี้)
                companyId:
                  type: integer
                  description: รหัสบริษัทของผู้ใช้ที่ส่งข้อความ
              required:
                - roomId
                - content
                - type
                - platform
                - companyId
              x-apidog-orders:
                - roomId
                - content
                - type
                - platform
                - companyId
            example:
              roomId: 26259b2c-509c-4ff5-a82a-d1b5505b014d
              content: Hello, world
              type: message
              platform: line
              companyId: 507
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          สถานะของ Business Code ถ้า

                          Success = 1000

                          Error 1 ตัว = 4001

                          Error มากกว่า 1 ตัว = 4002    

                          หรือเป็น Subcode ที่ต้องการจะแสดงเพื่อสื่อความหมายของ
                          Error โดย subcode จะเป็นตัวเดียวกับ business error
                          code หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: object
                    properties:
                      vwId:
                        type: string
                        description: รหัสข้อความสำหรับระบบภายใน
                      id:
                        type: string
                        description: รหัสข้อความ
                      roomId:
                        type: string
                        description: รหัสห้องแชทที่ข้อความถูกส่งไป
                      platform:
                        type: string
                        description: แพลตฟอร์มที่ใช้
                      user:
                        type: object
                        properties:
                          id:
                            type: string
                            description: ' รหัสผู้ใช้'
                          companyId:
                            type: string
                            description: รหัสบริษัทที่ผู้ใช้สังกัด
                          type:
                            type: string
                            description: ประเภทผู้ใช้
                          originalName:
                            type: string
                            description: ชื่อดั้งเดิมของผู้ใช้
                          originalName_EN:
                            type: string
                            description: ชื่อดั้งเดิมภาษาอังกฤษของผู้ใช้
                          avatar:
                            type: string
                            description: ลิงก์รูปโปรไฟล์ของผู้ใช้
                          role:
                            type: string
                            description: บทบาทของผู้ใช้
                          displayName:
                            type: string
                            description: ชื่อที่แสดงในห้องแชท
                        x-apidog-orders:
                          - id
                          - companyId
                          - type
                          - originalName
                          - originalName_EN
                          - avatar
                          - role
                          - displayName
                        required:
                          - id
                          - displayName
                          - role
                          - avatar
                          - originalName_EN
                          - originalName
                          - type
                          - companyId
                      content:
                        type: string
                        description: เนื้อหาของข้อความที่ส่ง
                      timestamp:
                        type: integer
                        description: เวลาที่ส่งข้อความ
                      type:
                        type: string
                        description: ประเภทของข้อความ
                      deliveryStatus:
                        type: string
                        description: สถานะการส่งข้อความ
                      traceId:
                        type: string
                        description: รหัสสำหรับติดตามการทำงานของข้อความในระบบ
                      isFirstCustomerMessage:
                        type: boolean
                        description: เป็นข้อความแรกของลูกค้าในห้องนี้หรือไม่
                    x-apidog-orders:
                      - vwId
                      - id
                      - roomId
                      - platform
                      - user
                      - content
                      - timestamp
                      - type
                      - deliveryStatus
                      - traceId
                      - isFirstCustomerMessage
                    required:
                      - vwId
                      - user
                      - platform
                      - roomId
                      - id
                      - content
                      - isFirstCustomerMessage
                      - traceId
                      - deliveryStatus
                      - type
                      - timestamp
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
              example:
                status:
                  code: '1000'
                  description: Success
                data:
                  vwId: string
                  id: string
                  roomId: string
                  platform: string
                  user:
                    id: string
                    companyId: string
                    type: string
                    originalName: string
                    originalName_EN: string
                    avatar: string
                    role: string
                    displayName: string
                  content: string
                  timestamp: 0
                  type: string
                  deliveryStatus: string
                  traceId: string
                  isFirstCustomerMessage: false
          headers: {}
          x-apidog-name: Created
        '400':
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: >-
                          สถานะของ Business Code ถ้า

                          Success = 1000

                          Error 1 ตัว = 4001

                          Error มากกว่า 1 ตัว = 4002    

                          หรือเป็น Subcode ที่ต้องการจะแสดงเพื่อสื่อความหมายของ
                          Error โดย subcode จะเป็นตัวเดียวกับ business error
                          code หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                  data:
                    type: object
                    properties:
                      errors:
                        type: object
                        properties:
                          subCode:
                            type: string
                            description: รหัสย่อยของข้อผิดพลาด
                          description:
                            type: string
                            description: ข้อความอธิบายรายละเอียดของข้อผิดพลาด
                        x-apidog-orders:
                          - subCode
                          - description
                        required:
                          - subCode
                          - description
                        description: รายละเอียดข้อผิดพลาดที่เกิดขึ้นกับ request
                    x-apidog-orders:
                      - errors
                    required:
                      - errors
                  01JYJXESQ106NKMJNRM6KGQDEF:
                    type: string
                x-apidog-orders:
                  - status
                  - data
                  - 01JYJXESQ106NKMJNRM6KGQDEF
                required:
                  - status
                  - data
                  - 01JYJXESQ106NKMJNRM6KGQDEF
              example:
                status:
                  code: '4001'
                  description: Business error with 1 or more errors
                data:
                  errors:
                    - subCode: E9503
                      description: Invalid acces rights
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
          headers: {}
          x-apidog-name: Unauthorized
      security:
        - bearer: []
      x-apidog-folder: Venio/Chat
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-18351108-run
components:
  schemas: {}
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
      description: ใส่ JWT Token ในรูปแบบ Bearer {token}
    bearer:
      type: http
      scheme: bearer
servers:
  - url: https://api.gofive.co.th
    description: Production
security:
  - bearerAuth: []
    x-apidog:
      schemeGroups:
        - id: uyL_cJmK7q60QJZRTi5ot
          schemeIds:
            - bearerAuth
      required: true
      use:
        id: uyL_cJmK7q60QJZRTi5ot
      scopes:
        uyL_cJmK7q60QJZRTi5ot:
          bearerAuth: []

```
