Google Drafts API

Operations related to Drafts

OpenAPI Specification

google-drafts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Google Books About Drafts API
  description: API for retrieving Bookshelf and Volume resources from Google Books
  version: 1.0.0
  contact:
    name: Google Books API
    url: https://developers.google.com/books
servers:
- url: https://www.googleapis.com/books/v1
  description: Google Books API v1
tags:
- name: Drafts
  description: Operations related to Drafts
paths:
  /gmail/v1/users/{userId}/drafts/send:
    post:
      tags:
      - Drafts
      summary: Google Send Drafts
      description: Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: '{{userID}}'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UsersDraftsSendPostRequest'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsersDraftsSendPostResponse'
              examples:
                UsersDraftsSendPostResponseExample:
                  $ref: '#/components/examples/UsersDraftsSendPostResponseExample'
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: UsersDraftsSendPostResponseExample
  /gmail/v1/users/{userId}/drafts/{id}:
    get:
      tags:
      - Drafts
      summary: Google Get Drafts
      description: Gets the specified draft.
      parameters:
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: '{{userId}}'
      - name: id
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GmailUsersDraftsGetResponse'
              examples:
                GmailUsersDraftsGetResponseExample:
                  $ref: '#/components/examples/GmailUsersDraftsGetResponseExample'
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: GmailUsersDraftsGetResponseExample
    put:
      tags:
      - Drafts
      summary: Google Update Drafts
      description: Replaces a draft's content.
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: incididunt labore i
      - name: id
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: incididunt labore i
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GmailUsersDraftsPutRequest'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GmailUsersDraftsPutResponse'
              examples:
                GmailUsersDraftsPutResponseExample:
                  $ref: '#/components/examples/GmailUsersDraftsPutResponseExample'
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: GmailUsersDraftsPutResponseExample
    delete:
      tags:
      - Drafts
      summary: Google Delete Drafts
      description: Immediately and permanently deletes the specified draft. Does not simply trash it.
      parameters:
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: incididunt labore i
      - name: id
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: incididunt labore i
      responses:
        '204':
          description: No Content
          content:
            text/plain:
              schema:
                type: string
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: SuccessExample
  /gmail/v1/users/{userId}/drafts:
    get:
      tags:
      - Drafts
      summary: Google List Drafts
      description: Lists the drafts in the user's mailbox.
      parameters:
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: '{{userID}}'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GmailUsersDraftsGetResponse1'
              examples:
                GmailUsersDraftsGetResponse1Example:
                  $ref: '#/components/examples/GmailUsersDraftsGetResponse1Example'
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: GmailUsersDraftsGetResponse1Example
    post:
      tags:
      - Drafts
      summary: Google Create Drafts
      description: Creates a new draft with the `DRAFT` label.
      parameters:
      - name: Content-Type
        in: header
        schema:
          type: string
        example: application/json
      - name: Accept
        in: header
        schema:
          type: string
        example: application/json
      - name: userId
        in: path
        schema:
          type: string
        required: true
        description: '(Required) '
        example: incididunt labore i
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GmailUsersDraftsPostRequest'
      responses:
        '200':
          description: OK
          headers:
            Content-Type:
              schema:
                type: string
                example: application/json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GmailUsersDraftsPostResponse'
              examples:
                GmailUsersDraftsPostResponseExample:
                  $ref: '#/components/examples/GmailUsersDraftsPostResponseExample'
      x-api-evangelist-processing:
        ChooseTags: true
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: GmailUsersDraftsPostResponseExample
components:
  schemas:
    GmailUsersDraftsPutResponseMessagePayloadBody:
      description: GmailUsersDraftsPutResponseMessagePayloadBody schema
      type: object
      properties:
        attachmentId:
          type: string
        size:
          type: integer
        data:
          type: string
    UsersDraftsSendPostResponse:
      description: UsersDraftsSendPostResponse schema
      type: object
      properties:
        id:
          type: string
        threadId:
          type: string
        labelIds:
          type: array
          items:
            type: string
        snippet:
          type: string
        historyId:
          type: string
        internalDate:
          type: string
        payload:
          $ref: '#/components/schemas/UsersDraftsSendPostResponsePayload'
        sizeEstimate:
          type: integer
        raw:
          type: string
    UsersDraftsSendPostRequest:
      description: UsersDraftsSendPostRequest schema
      type: object
      example:
        id: elit Lorem
        message:
          id: elit
          threadId: enim ut ut fugiat
          labelIds:
          - incididunt et non cupidatat
          - laboris deserunt do nostrud
          snippet: nostrud in
          historyId: ullamco
          internalDate: dolor ullamco elit fugiat
          payload:
            partId: consequat ipsum qui
            mimeType: enim quis dolor aliqua veniam
            filename: laboris ad
            headers:
            - name: labore aute nisi
              value: reprehenderit esse ex elit
            - name: sed
              value: anim ut veniam elit
            body:
              attachmentId: irure
              size: -58003592
              data: officia laboris
            parts:
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          sizeEstimate: -74092231
          raw: in enim sit pariatur
    GmailUsersDraftsGetResponse1:
      description: GmailUsersDraftsGetResponse1 schema
      type: object
      properties:
        drafts:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
              message:
                type: object
                properties:
                  id:
                    type: string
                  threadId:
                    type: string
                  labelIds:
                    type: array
                    items:
                      type: string
                  snippet:
                    type: string
                  historyId:
                    type: string
                  internalDate:
                    type: string
                  payload:
                    type: object
                    properties:
                      partId:
                        type: string
                      mimeType:
                        type: string
                      filename:
                        type: string
                      headers:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                      body:
                        type: object
                        properties:
                          attachmentId:
                            type: string
                          size:
                            type: integer
                          data:
                            type: string
                      parts:
                        type: array
                        items:
                          type: object
                          properties:
                            value:
                              type: string
                  sizeEstimate:
                    type: integer
                  raw:
                    type: string
        nextPageToken:
          type: string
        resultSizeEstimate:
          type: integer
    GmailUsersDraftsGetResponse:
      description: GmailUsersDraftsGetResponse schema
      type: object
      properties:
        id:
          type: string
        message:
          $ref: '#/components/schemas/GmailUsersDraftsGetResponseMessage'
    GmailUsersDraftsGetResponseMessagePayloadBody:
      description: GmailUsersDraftsGetResponseMessagePayloadBody schema
      type: object
      properties:
        attachmentId:
          type: string
        size:
          type: integer
        data:
          type: string
    GmailUsersDraftsPostResponseMessagePayloadBody:
      description: GmailUsersDraftsPostResponseMessagePayloadBody schema
      type: object
      properties:
        attachmentId:
          type: string
        size:
          type: integer
        data:
          type: string
    GmailUsersDraftsGetResponseMessage:
      description: GmailUsersDraftsGetResponseMessage schema
      type: object
      properties:
        id:
          type: string
        threadId:
          type: string
        labelIds:
          type: array
          items:
            type: string
        snippet:
          type: string
        historyId:
          type: string
        internalDate:
          type: string
        payload:
          $ref: '#/components/schemas/GmailUsersDraftsGetResponseMessagePayload'
        sizeEstimate:
          type: integer
        raw:
          type: string
    GmailUsersDraftsPostResponse:
      description: GmailUsersDraftsPostResponse schema
      type: object
      properties:
        id:
          type: string
        message:
          $ref: '#/components/schemas/GmailUsersDraftsPostResponseMessage'
    GmailUsersDraftsPutResponse:
      description: GmailUsersDraftsPutResponse schema
      type: object
      properties:
        id:
          type: string
        message:
          $ref: '#/components/schemas/GmailUsersDraftsPutResponseMessage'
    GmailUsersDraftsPutResponseMessagePayload:
      description: GmailUsersDraftsPutResponseMessagePayload schema
      type: object
      properties:
        partId:
          type: string
        mimeType:
          type: string
        filename:
          type: string
        headers:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: string
        body:
          $ref: '#/components/schemas/GmailUsersDraftsPutResponseMessagePayloadBody'
        parts:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
    GmailUsersDraftsPutResponseMessage:
      description: GmailUsersDraftsPutResponseMessage schema
      type: object
      properties:
        id:
          type: string
        threadId:
          type: string
        labelIds:
          type: array
          items:
            type: string
        snippet:
          type: string
        historyId:
          type: string
        internalDate:
          type: string
        payload:
          $ref: '#/components/schemas/GmailUsersDraftsPutResponseMessagePayload'
        sizeEstimate:
          type: integer
        raw:
          type: string
    GmailUsersDraftsPostRequest:
      description: GmailUsersDraftsPostRequest schema
      type: object
      example:
        raw: '{{encodedMessage}}'
    GmailUsersDraftsPostResponseMessage:
      description: GmailUsersDraftsPostResponseMessage schema
      type: object
      properties:
        id:
          type: string
        threadId:
          type: string
        labelIds:
          type: array
          items:
            type: string
        snippet:
          type: string
        historyId:
          type: string
        internalDate:
          type: string
        payload:
          $ref: '#/components/schemas/GmailUsersDraftsPostResponseMessagePayload'
        sizeEstimate:
          type: integer
        raw:
          type: string
    UsersDraftsSendPostResponsePayloadBody:
      description: UsersDraftsSendPostResponsePayloadBody schema
      type: object
      properties:
        attachmentId:
          type: string
        size:
          type: integer
        data:
          type: string
    GmailUsersDraftsPutRequest:
      description: GmailUsersDraftsPutRequest schema
      type: object
      example:
        id: elit Lorem
        message:
          id: elit
          threadId: enim ut ut fugiat
          labelIds:
          - incididunt et non cupidatat
          - laboris deserunt do nostrud
          snippet: nostrud in
          historyId: ullamco
          internalDate: dolor ullamco elit fugiat
          payload:
            partId: consequat ipsum qui
            mimeType: enim quis dolor aliqua veniam
            filename: laboris ad
            headers:
            - name: labore aute nisi
              value: reprehenderit esse ex elit
            - name: sed
              value: anim ut veniam elit
            body:
              attachmentId: irure
              size: -58003592
              data: officia laboris
            parts:
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          sizeEstimate: -74092231
          raw: in enim sit pariatur
    GmailUsersDraftsGetResponseMessagePayload:
      description: GmailUsersDraftsGetResponseMessagePayload schema
      type: object
      properties:
        partId:
          type: string
        mimeType:
          type: string
        filename:
          type: string
        headers:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: string
        body:
          $ref: '#/components/schemas/GmailUsersDraftsGetResponseMessagePayloadBody'
        parts:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
    UsersDraftsSendPostResponsePayload:
      description: UsersDraftsSendPostResponsePayload schema
      type: object
      properties:
        partId:
          type: string
        mimeType:
          type: string
        filename:
          type: string
        headers:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: string
        body:
          $ref: '#/components/schemas/UsersDraftsSendPostResponsePayloadBody'
        parts:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
    GmailUsersDraftsPostResponseMessagePayload:
      description: GmailUsersDraftsPostResponseMessagePayload schema
      type: object
      properties:
        partId:
          type: string
        mimeType:
          type: string
        filename:
          type: string
        headers:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              value:
                type: string
        body:
          $ref: '#/components/schemas/GmailUsersDraftsPostResponseMessagePayloadBody'
        parts:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
  examples:
    GmailUsersDraftsPutResponseExample:
      summary: Successful 200 response
      value:
        id: elit Lorem
        message:
          id: elit
          threadId: enim ut ut fugiat
          labelIds:
          - incididunt et non cupidatat
          - laboris deserunt do nostrud
          snippet: nostrud in
          historyId: ullamco
          internalDate: dolor ullamco elit fugiat
          payload:
            partId: consequat ipsum qui
            mimeType: enim quis dolor aliqua veniam
            filename: laboris ad
            headers:
            - name: labore aute nisi
              value: reprehenderit esse ex elit
            - name: sed
              value: anim ut veniam elit
            body:
              attachmentId: irure
              size: -58003592
              data: officia laboris
            parts:
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          sizeEstimate: -74092231
          raw: in enim sit pariatur
    UsersDraftsSendPostResponseExample:
      summary: Successful 200 response
      value:
        id: eu incididunt laborum irure
        threadId: magna Ut officia
        labelIds:
        - mollit amet dolore cupidatat
        - cupidatat deserunt mollit
        snippet: ut dolor
        historyId: nisi tempor do
        internalDate: cupidatat officia anim
        payload:
          partId: dolore velit incididunt est a
          mimeType: sit dolor mollit
          filename: ea commodo dolor nisi
          headers:
          - name: quis id velit laborum
            value: et voluptate dolor ea
          - name: sit nostrud
            value: deserunt fugiat ex
          body:
            attachmentId: id nulla consequat
            size: -93837667
            data: ad in occaecat
          parts:
          - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          - value: '<Circular reference to #/components/schemas/MessagePart detected>'
        sizeEstimate: 21128811
        raw: do laboris
    GmailUsersDraftsPostResponseExample:
      summary: Successful 200 response
      value:
        id: elit Lorem
        message:
          id: elit
          threadId: enim ut ut fugiat
          labelIds:
          - incididunt et non cupidatat
          - laboris deserunt do nostrud
          snippet: nostrud in
          historyId: ullamco
          internalDate: dolor ullamco elit fugiat
          payload:
            partId: consequat ipsum qui
            mimeType: enim quis dolor aliqua veniam
            filename: laboris ad
            headers:
            - name: labore aute nisi
              value: reprehenderit esse ex elit
            - name: sed
              value: anim ut veniam elit
            body:
              attachmentId: irure
              size: -58003592
              data: officia laboris
            parts:
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          sizeEstimate: -74092231
          raw: in enim sit pariatur
    GmailUsersDraftsGetResponse1Example:
      summary: Successful 200 response
      value:
        drafts:
        - id: labore do cupidatat dolor consectetur
          message:
            id: cillum incididunt eiusmod anim
            threadId: quis non proident
            labelIds:
            - dolor dol
            - nulla ad sed exercitation
            snippet: aute ad
            historyId: quis anim a
            internalDate: sint dolore
            payload:
              partId: enim nulla ad
              mimeType: id ani
              filename: pariatur
              headers:
              - name: dolor est
                value: veniam ut nostrud culpa
              - name: sed minim
                value: ipsum occaecat sed dolor
              body:
                attachmentId: dolore quis et
                size: -13145088
                data: pariatur magna in Duis in
              parts:
              - value: '<Circular reference to #/components/schemas/MessagePart detected>'
              - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            sizeEstimate: -49941379
            raw: non veniam eiusmod
        - id: anim
          message:
            id: consectetur
            threadId: veniam in fugiat adipisicing esse
            labelIds:
            - ut
            - anim proident magna esse
            snippet: quis tempor laborum officia fugiat
            historyId: dolor
            internalDate: cupidatat velit ut sint in
            payload:
              partId: tempor
              mimeType: deseru
              filename: dolore veniam
              headers:
              - name: veni
                value: eu in
              - name: qui irure aliqua cupidatat
                value: commodo laborum nostrud id
              body:
                attachmentId: non eiusmod Excepteur
                size: 69980865
                data: Excepteur reprehenderit proident sed
              parts:
              - value: '<Circular reference to #/components/schemas/MessagePart detected>'
              - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            sizeEstimate: 15653869
            raw: ipsum dolor qui
        nextPageToken: veniam laborum labore Ut aliquip
        resultSizeEstimate: 46963148
    GmailUsersDraftsGetResponseExample:
      summary: Successful 200 response
      value:
        id: elit Lorem
        message:
          id: elit
          threadId: enim ut ut fugiat
          labelIds:
          - incididunt et non cupidatat
          - laboris deserunt do nostrud
          snippet: nostrud in
          historyId: ullamco
          internalDate: dolor ullamco elit fugiat
          payload:
            partId: consequat ipsum qui
            mimeType: enim quis dolor aliqua veniam
            filename: laboris ad
            headers:
            - name: labore aute nisi
              value: reprehenderit esse ex elit
            - name: sed
              value: anim ut veniam elit
            body:
              attachmentId: irure
              size: -58003592
              data: officia laboris
            parts:
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
            - value: '<Circular reference to #/components/schemas/MessagePart detected>'
          sizeEstimate: -74092231
          raw: in enim sit pariatur
  securitySchemes:
    OAuth2:
      type: oauth2
      description: OAuth 2.0 authentication for Google Books API
      flows:
        authorizationCode:
          authorizationUrl: https://accounts.google.com/o/oauth2/v2/auth
          tokenUrl: https://oauth2.googleapis.com/token
          scopes:
            https://www.googleapis.com/auth/books: Manage your Google Books library