Tricentis Attachment API

Attachment API

OpenAPI Specification

tricentis-attachment-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  description: "[Introduction to qTest API Specification](https://documentation.tricentis.com/qtest/od/en/content/apis/overview/qtest_api_specification.htm) \n[How to use interactive API Doc](https://documentation.tricentis.com/qtest/od/en/content/apis/overview/how_to_use_interactive_api_documentation.htm)\n The bearer token can be found at `[qtestUrl/p/{projectId}/portal/project#tab=resource]` under the API & SDK tab."
  version: v3.0
  title: qTest Manager API Version 3.0 Attachment API
servers:
- url: https://apitryout.qtestnet.com/
tags:
- name: attachment
  description: Attachment API
paths:
  /api/v3/projects/{projectId}/attachments:
    get:
      tags:
      - attachment
      summary: Searches for Attachments
      description: To query for attachments of <em>Releases</em>, <em>Builds</em>, <em>Requirements</em>, <em>Test Cases</em>, <em>Test Logs</em>, <em>Test Steps</em> or <em>Defects</em>
      operationId: search
      parameters:
      - name: projectId
        in: path
        description: ID of the project
        required: true
        schema:
          type: integer
          format: int64
      - name: type
        in: query
        description: Its valid values include <em>releases</em>, <em>builds</em>, <em>requirements</em>, <em>test-cases</em>, <em>test-steps</em>, <em>test-logs</em> or <em>defects</em>
        required: true
        schema:
          type: string
          enum:
          - releases
          - builds
          - requirements
          - test-cases
          - test-steps
          - test-logs
          - defects
      - name: ids
        in: query
        description: List of object IDs (of the same type as specified in the parameter above), separated by commas
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: integer
            format: int64
      - name: author
        in: query
        description: ID of the user who created the attachment
        required: false
        schema:
          type: integer
          format: int64
      - name: createdDate
        in: query
        description: 'Its format is: <strong>{operator} {createdDate in timestamp or UTC}</strong>


          The <em>operator</em> can be one of the following values:


          <b>lt</b>: less than the given date


          <b>gt</b>: greater than given date


          <b>eq</b>: equal to the given date


          <b>le</b>: less than or equal to the given date


          <b>ge</b>: greater then or equal to the given date'
        required: false
        schema:
          type: string
      - name: pageSize
        in: query
        description: The result is paginated. By the default, the number of objects in each page is 100 if this is omitted. You can specify your custom number (up to 999) in this parameter
        required: false
        schema:
          type: integer
          format: int64
          default: 100
      - name: page
        in: query
        description: By default, the first page is returned but you can specify any page number to retrieve attachments
        required: false
        schema:
          type: integer
          format: int64
          default: 1
      responses:
        200:
          description: Return attachment list of Release, Build, Requirement, Test Case, Test Log, Test Step and Defect.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PagedResourceAttachmentResource'
      security:
      - Authorization: []
  /api/v3/projects/{projectId}/{objectType}/{objectId}/attachments:
    get:
      tags:
      - attachment
      summary: Gets all Attachments of an Object
      description: To retrieve all Attachments of a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect
      operationId: getAttachmentsOf
      parameters:
      - name: projectId
        in: path
        description: ID of the project
        required: true
        schema:
          type: integer
          format: int64
      - name: objectType
        in: path
        description: Valid values include <em>release</em>, <em>build</em>, <em>requirements</em>, <em>test-cases</em>, <em>test-logs</em>, <em>test-steps</em>, <em>test-step-logs</em> or <em>defects</em>
        required: true
        schema:
          type: string
          enum:
          - releases
          - builds
          - requirements
          - test-cases
          - test-logs
          - test-steps
          - test-step-logs
          - defects
      - name: objectId
        in: path
        description: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect)
        required: true
        schema:
          type: integer
          format: int64
      responses:
        200:
          description: Return list of attachments from a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AttachmentResource'
      security:
      - Authorization: []
  /api/v3/projects/{projectId}/{objectType}/{objectId}/attachments/{attachmentId}:
    get:
      tags:
      - attachment
      summary: Gets an Attachment of an Object
      description: To retrieve an Attachment from a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect
      operationId: getAttachment
      parameters:
      - name: projectId
        in: path
        description: ID of the project
        required: true
        schema:
          type: integer
          format: int64
      - name: attachmentId
        in: path
        description: ID of attachment
        required: true
        schema:
          type: integer
          format: int64
      - name: forceDownload
        in: query
        description: Input true to download attachments which have not been scanned for malware/virus successfully. By default, its value is false
        required: false
        schema:
          type: boolean
          default: false
      - name: objectType
        in: path
        description: Valid values include <em>release</em>, <em>build</em>, <em>requirements</em>, <em>test-cases</em>, <em>test-logs</em>, <em>test-steps</em>, <em>test-step-logs</em> or <em>defects</em>
        required: true
        schema:
          type: string
          enum:
          - releases
          - builds
          - requirements
          - test-cases
          - test-logs
          - test-steps
          - test-step-logs
          - defects
      - name: objectId
        in: path
        description: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step Test Step Log or Defect)
        required: true
        schema:
          type: integer
          format: int64
      responses:
        200:
          description: Return specific attachment from a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OutputStream'
      security:
      - Authorization: []
  /api/v3/projects/{projectId}/{objectType}/{objectId}/blob-handles:
    post:
      tags:
      - attachment
      summary: Uploads an Attachment to an Object
      description: To upload an Attachment to a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect
      operationId: upload
      parameters:
      - name: projectId
        in: path
        description: ID of the project
        required: true
        schema:
          type: integer
          format: int64
      - name: objectType
        in: path
        description: 'Valid values include releases, builds, requirements, test-cases, test-logs, test-steps, test-step-logs or defects


          <strong>qTest Manager version:</strong> 4+'
        required: true
        schema:
          type: string
          enum:
          - releases
          - builds
          - requirements
          - test-cases
          - test-logs
          - test-steps
          - test-step-logs
          - defects
      - name: objectId
        in: path
        description: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect)
        required: true
        schema:
          type: integer
          format: int64
      - name: File-Name
        in: header
        required: true
        schema:
          type: string
      - name: Content-Type
        in: header
        required: true
        schema:
          type: string
      responses:
        201:
          description: Uploaded successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachmentResource'
        400:
          description: Bad Request - Unexpected error occurred
        413:
          description: Request Entity Too Large - The attachment is too large
        500:
          description: Internal Server Error - Unexpected error occurred
      security:
      - Authorization: []
      requestBody:
        content:
          application/json:
            schema:
              type: string
              format: binary
        required: true
  /api/v3/projects/{projectId}/{objectType}/{objectId}/blob-handles/{blobHandleId}:
    delete:
      tags:
      - attachment
      summary: Deletes an Attachment from an Object
      description: 'To delete an Attachment from a Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect


        <strong>qTest Manager version:</strong> 7.5+'
      operationId: deleteByBlobHandleId
      parameters:
      - name: projectId
        in: path
        description: ID of the project
        required: true
        schema:
          type: integer
          format: int64
      - name: blobHandleId
        in: path
        description: ID of the Attachment
        required: true
        schema:
          type: integer
          format: int64
      - name: objectType
        in: path
        description: 'Valid values include releases, builds, requirements, test-cases, test-logs, test-steps, test-step-logs or defects


          <strong>qTest Manager version:</strong> 4+'
        required: true
        schema:
          type: string
          enum:
          - releases
          - builds
          - requirements
          - test-cases
          - test-logs
          - test-steps
          - test-step-logs
          - defects
      - name: objectId
        in: path
        description: ID of the object (Release, Build, Requirement, Test Case, Test Log, Test Step, Test Step Log or Defect)
        required: true
        schema:
          type: integer
          format: int64
      responses:
        200:
          description: Deleted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Message'
        400:
          description: Bad Request - Unexpected error occurred
        403:
          description: Access Denied
        404:
          description: Blob Handle not found
      security:
      - Authorization: []
components:
  schemas:
    Message:
      type: object
      properties:
        noLogging:
          type: boolean
        message:
          type: string
          example: Error message
          description: Error message text
          readOnly: true
    OutputStream:
      type: object
    AttachmentResource:
      type: object
      properties:
        links:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/Link'
        name:
          type: string
          example: Sample.docx
          description: Attachment name
        content_type:
          type: string
          example: application/vnd.openxmlformats-officedocument.wordprocessingml.document
          description: Attachment content type
        data:
          type: string
          description: Used for uploading and ignored during download
        id:
          type: integer
          format: int64
          example: 1
          description: ID of the Attachment
        web_url:
          type: string
          example: https://apitryout.qtestnet.com/p/1/portal/attachment/testcase/attachmentId/1
          description: Web URL to Attachment
          readOnly: true
        created_date:
          type: string
          format: date-time
          description: The date Attachment was created
        author:
          $ref: '#/components/schemas/AttachmentAuthor'
        artifact_id:
          type: integer
          format: int64
          example: 1
          description: Artifact ID which Attachment linked to
          readOnly: true
    Link:
      type: object
      properties:
        rel:
          type: string
          example: self
          description: Relationship of link to object
        href:
          type: string
          example: <link to object>
          description: URL to the resource
    AttachmentAuthor:
      type: object
      properties:
        id:
          type: integer
          format: int64
          example: 1
          description: ID of the User
        email:
          type: string
          example: example.user@qtest.com
          description: Login username of the User
        first_name:
          type: string
          example: First name of the User
          description: First name of the User
        last_name:
          type: string
          example: Last name of the User
          description: Last name of the User
    PagedResourceAttachmentResource:
      type: object
      properties:
        links:
          type: array
          readOnly: true
          items:
            $ref: '#/components/schemas/Link'
        page:
          type: integer
          format: int32
        page_size:
          type: integer
          format: int32
        total:
          type: integer
          format: int64
        items:
          type: array
          items:
            $ref: '#/components/schemas/AttachmentResource'
  securitySchemes:
    Authorization:
      type: apiKey
      name: Authorization
      in: header