# Create  Customer Satisfaction 

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /v3/customers/satisfaction:
    post:
      summary: 'Create  Customer Satisfaction '
      deprecated: false
      description: เพิ่มข้อมูล Customer Satisfaction
      tags:
        - Venio/Customer
        - VenioCRM/Customer
      parameters:
        - name: Content-Type
          in: header
          description: ''
          required: true
          example: application/json
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: รหัส subscription keyลูกค้า
          required: true
          example: <Your Subscription-Key>
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                AnswerBy:
                  type: string
                  description: >
                    ชื่อของผู้ที่ให้คำตอบ ในตัวอย่างนี้กำหนดเป็น "Bob Name."

                    The person who provided the answer. In this example, "Bob
                    Name"
                SourceName:
                  type: string
                  description: >-
                    ชื่อของแหล่งที่มา ในตัวอย่างนี้กำหนดเป็น "NPS [Venio]."
                    คุณสามารถเพิ่มคำตอบเข้าไปยังแหล่งที่มาได้ด้วยการ
                    ใช้ชื่อแหล่งที่มาเดิม 

                    หากคุณใช้ชื่อแหล่งที่มา ใหม่เพิ่มเข้ามา เช่น 

                    NPS [E-TaxGo] คุณจะได้แบ่งเป็นแหล่งที่มาหมวดหมู่ใหม่ 
                SourceType:
                  type: integer
                  description: |-
                    ประเภทของแหล่งข้อมูลความพึงพอใจของลูกค้า 
                     1 แทนประเภทสำหรับ CSAT.
                     2 แทนประเภทสำหรับ NPS.
                  x-apidog-mock: '1'
                Point:
                  type: integer
                  description: |+
                    คะแนนความพึงพอใจที่ลูกค้าให้ เป็นจำนวนเต็ม 

                    ข้อกำหนดสำหรับ SourceType 
                    1.The Point for CSAT 1 - 5.
                    2.The Point for NPS 1 - 10.

                Comment:
                  type: string
                  description: >-
                    ความคิดเห็นหรือข้อเสนอแนะเพิ่มเติมจากลูกค้า ความยาวไม่เกิน
                    2500 ตัวอักษร
                CustomerCode:
                  type: string
                  description: รหัสลูกค้า
                DateCreated:
                  type: string
                  description: |-
                    วันที่และเวลาเมื่อข้อมูลเกี่ยวกับความพึงพอใจถูกสร้างขึ้น 
                    รูปแบบที่สามารถรับได้ 
                    - yyyy-MM-dd 
                    - yyyy-MM-dd HH:mm:ss 
                    =========================== 
                    yyyy: Year with four digits. (AD counting years)
                    MM: Month with two digits.
                    dd: Day with two digits. 
                    HH: Hours in 24-hour format with two digits.
                    mm: Minutes with two digits. 
                    ss: Seconds with two digits.
              required:
                - SourceName
                - SourceType
                - Point
                - CustomerCode
                - DateCreated
              x-apidog-orders:
                - AnswerBy
                - SourceName
                - SourceType
                - Point
                - Comment
                - CustomerCode
                - DateCreated
              x-apidog-ignore-properties: []
            example:
              AnswerBy: ์Bob Name
              SourceName: NPS [Venio]
              SourceType: 2
              Point: 6
              Comment: appreciated
              CustomerCode: C2300317
              DateCreated: '2023-12-04 12:00:00.000'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                      description:
                        type: string
                    required:
                      - code
                      - description
                    x-apidog-orders:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      id:
                        type: integer
                      answerBy:
                        type: string
                      dateCreated:
                        type: string
                      sourceId:
                        type: integer
                      point:
                        type: integer
                      comment:
                        type: string
                      customerCode:
                        type: string
                      customerId:
                        type: integer
                      source:
                        type: object
                        properties:
                          sourceId:
                            type: integer
                          dateCreated:
                            type: string
                          sourceName:
                            type: string
                          sourceType:
                            type: integer
                          companyId:
                            type: integer
                        required:
                          - sourceId
                          - dateCreated
                          - sourceName
                          - sourceType
                          - companyId
                        x-apidog-orders:
                          - sourceId
                          - dateCreated
                          - sourceName
                          - sourceType
                          - companyId
                        x-apidog-ignore-properties: []
                    required:
                      - id
                      - answerBy
                      - dateCreated
                      - sourceId
                      - point
                      - comment
                      - customerCode
                      - customerId
                      - source
                    x-apidog-orders:
                      - id
                      - answerBy
                      - dateCreated
                      - sourceId
                      - point
                      - comment
                      - customerCode
                      - customerId
                      - source
                    x-apidog-ignore-properties: []
                required:
                  - status
                  - data
                x-apidog-orders:
                  - status
                  - data
                x-apidog-ignore-properties: []
              example:
                status:
                  code: '1000'
                  description: Success
                data:
                  id: 12
                  answerBy: ์Bob Name
                  dateCreated: 2023-12-04T12:00:00+0700
                  sourceId: 5
                  point: 6
                  comment: appreciated
                  customerCode: C2300317
                  customerId: 149252
                  source:
                    sourceId: 5
                    dateCreated: 2023-12-04T12:00:00+0700
                    sourceName: NPS [Venio]
                    sourceType: 2
                    companyId: 1005
          headers: {}
          x-apidog-name: OK
        '400':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: "คำบรรยายsubcode/business\_code"
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                  data:
                    type: object
                    properties:
                      errors:
                        type: array
                        items:
                          type: object
                          properties:
                            subCode:
                              type: string
                              description: "<p>สถานะของ Business Code ถ้า<br>Success = 1000<br>Error 1 ตัว = 4001<br>Error มากกว่า 1 ตัว = 4002\_ \_ <br>หรือเป็น Subcode ที่ต้องการจะแสดงเพื่อมีความหมายสำหรับ Module ของเจ้าของในการดู Error โดย subcode จะเป็นตัวเดียวกับ business error code หรือไม่ก็ได้ เพื่อความสะดวกในการแสดงผล<p>"
                            description:
                              type: string
                              description: "คำบรรยาย\_business\_code/subcode"
                          x-apidog-orders:
                            - subCode
                            - description
                          required:
                            - subCode
                            - description
                          x-apidog-ignore-properties: []
                        description: >-
                          เป็นส่วนแสดงผล Error
                          ที่พบว่ามีจำนวนกี่ชุดก็ได้ไม่จำกัดเพื่อความสะดวกในการจัดการกับ
                          Error
                    x-apidog-orders:
                      - errors
                    required:
                      - errors
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                  - data
                required:
                  - status
                  - data
                x-apidog-ignore-properties: []
              examples:
                '2':
                  summary: Bad Request (400)
                  value:
                    status:
                      code: '4002'
                      description: Business error with 1 or more errors
                    data:
                      errors:
                        - subCode: E1101
                          description: The CustomerCode field is required.
                        - subCode: E1101
                          description: The SourceName field is required.
                        - subCode: E1101
                          description: The SourceType field is required.
                        - subCode: E1101
                          description: The DateCreated field is required.
                '3':
                  summary: The Point Invalid (400) CSAT
                  value:
                    status:
                      code: '4001'
                      description: Business error with 1 or more errors
                    data:
                      errors:
                        - subCode: E1102
                          description: The Point for CSAT invalid point need to be 1 - 5.
                '4':
                  summary: Invalid Data Format (400) Point
                  value:
                    errors:
                      model:
                        - The model field is required.
                      point:
                        - >-
                          Input string '9.5' is not a valid integer. Path
                          'Point', line 5, position 15.
                    type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                    title: One or more validation errors occurred.
                    status: 400
                    extensions:
                      traceId: 00-17402b980ea1d801930e52e5182f449d-256a80a817b3c578-00
                '6':
                  summary: Invalid Data format (400) DateCreated
                  value:
                    errors:
                      model:
                        - The model field is required.
                      dateCreated:
                        - >-
                          Could not convert string to DateTime: 2023-12-xx
                          12:00:00. Path 'DateCreated', line 8, position 40.
                    type: https://tools.ietf.org/html/rfc7231#section-6.5.1
                    title: One or more validation errors occurred.
                    status: 400
                    extensions:
                      traceId: 00-c5fc994703b6dde69ef536807c01c260-955718ccb3f9f088-00
          headers: {}
          x-apidog-name: Bad Request
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: integer
                    description: |-
                      สถานะ code ของ httpเช่น
                      200 Ok
                      201 Created
                      400 BadRequest
                      401 Unauthorized
                      404 Record not found
                      500 Internal Server Error
                  message:
                    type: string
                    description: คำบรรยาย error
                x-apidog-orders:
                  - statusCode
                  - message
                required:
                  - statusCode
                  - message
                x-apidog-ignore-properties: []
              example:
                statusCode: 401
                message: Access denied due to invalid subscription key. Mak ...
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: คำอธิบายข้อความที่จะแสดง
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                required:
                  - status
                x-apidog-ignore-properties: []
              example:
                status:
                  code: E9503
                  description: Invalid access rights
          headers: {}
          x-apidog-name: Forbidden
        '500':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: object
                    properties:
                      code:
                        type: string
                        description: "<p>สถานะของ\_Business\_Code\_ถ้า<br>Success\_=\_1000<br>Error\_1\_ตัว\_=\_4001<br>Error\_มากกว่า\_1\_ตัว\_=\_4002\_\_\_\_<br>หรือเป็น\_Subcode\_ที่ต้องการจะแสดงเพื่อสื่อความหมายของ\_Error\_โดย\_subcode\_จะเป็นตัวเดียวกับ\_business\_error\_code\_หรือไม่ก็ได้\_เพื่อความสะดวกในการแสดงผล<p>"
                      description:
                        type: string
                        description: "คำบรรยาย\_subcode/business\_code"
                    x-apidog-orders:
                      - code
                      - description
                    required:
                      - code
                      - description
                    x-apidog-ignore-properties: []
                x-apidog-orders:
                  - status
                required:
                  - status
                x-apidog-ignore-properties: []
              example:
                status:
                  code: E9905
                  description: string
          headers: {}
          x-apidog-name: (E9905)
        x-200:User authentication required V2.:
          description: ''
          content:
            application/json:
              schema:
                title: ''
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Required%20authorization'
                  status:
                    $ref: '#/components/schemas/Response%20Error%20Msg%20'
                required:
                  - data
                  - status
                x-apidog-orders:
                  - data
                  - status
                x-apidog-ignore-properties: []
              example:
                data:
                  subCode: E9103
                  description: Authorization credentials required
                  metadata: {}
                status:
                  code: '4001'
                  description: Business error with 1 errors
          headers: {}
          x-apidog-name: User authentication required V2.
      security:
        - bearer: []
      x-apidog-folder: Venio/Customer
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-4823671-run
components:
  schemas:
    'Response Error Msg ':
      type: object
      properties:
        code:
          type: string
          x-apidog-mock: '4001'
        description:
          type: string
          x-apidog-mock: Business error with 1 errors
      required:
        - code
        - description
      x-apidog-orders:
        - code
        - description
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
    Required authorization:
      type: object
      properties:
        subCode:
          type: string
          x-apidog-mock: E9103
        description:
          type: string
          x-apidog-mock: Authorization credentials required
        metadata:
          type: object
          properties: {}
          x-apidog-orders: []
          x-apidog-ignore-properties: []
      required:
        - subCode
        - description
        - metadata
      x-apidog-orders:
        - subCode
        - description
        - metadata
      x-apidog-ignore-properties: []
      x-apidog-folder: ''
  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: []

```
