# Download Document By Id

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /Documents/Download/{DocumentType}/{DoucumentId}:
    get:
      summary: Download Document By Id
      deprecated: false
      description: ''
      tags:
        - eTaxGo/Document Management
        - Documents
      parameters:
        - name: DocumentType
          in: path
          description: ประเภทเอกสาร จะต้องระบุเป็นประเภท pdf หรือ xml เท่านั้น
          required: true
          example: ''
          schema:
            type: string
        - name: DoucumentId
          in: path
          description: รหัสเอกสาร คือ DocumentNo ตัวอย่าง 123456789AB
          required: true
          example: ''
          schema:
            type: string
        - name: Ocp-Apim-Subscription-Key
          in: header
          description: รหัส subscription key ของลูกค้า
          required: true
          example: ''
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            OAuth token obtained after the user has provided consent and the
            authorized partner calls the /authorization/Connect/Token endpoint
            to retrieve this token
          required: true
          example: ''
          schema:
            type: string
        - name: Content-Type
          in: header
          description: |-

            Content type of request payload
            Value:
            - application/json
          required: true
          example: ''
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  fileStream:
                    type: string
                    description: ไฟล์ Byte []
                  fileType:
                    type: string
                    description: ประเภทไฟล์
                  status:
                    type: string
                    description: สถานะ
                  errorMessage:
                    type: string
                    description: ข้อความผิดพลาด
                  httpStatusCode:
                    type: integer
                    description: รหัส Http
                  statusCode:
                    type: integer
                    description: รหัสสถานะ
                required:
                  - fileStream
                  - fileType
                  - status
                  - errorMessage
                  - httpStatusCode
                  - statusCode
                x-apidog-orders:
                  - fileStream
                  - fileType
                  - status
                  - errorMessage
                  - httpStatusCode
                  - statusCode
                x-apidog-ignore-properties: []
              example:
                fileStream: afewriewo15e6fdsfder6648xvaa
                fileType: PDF
                status: Success
                errorMessage: Not found
                statusCode: 1000
                httpStatusCode: 200
          headers: {}
          x-apidog-name: 'OK '
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Unauthorized
        '403':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x-apidog-orders: []
                x-apidog-ignore-properties: []
          headers: {}
          x-apidog-name: Forbidden
        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: eTaxGo/Document Management
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/351895/apis/api-3627537-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: []

```
