Knowledge Base

Stream record content

Changed on

Stream the binary content of a record's file.

Overview:

Returns the stored file's bytes with the file's own Content-Type (for an uploaded file, the MIME type it was uploaded with, followed by ; charset=utf-8, for example text/plain; charset=utf-8 or application/json; charset=utf-8). No Content-Disposition header is sent for uploaded files.

Use cases:

  • File downloads
  • Inline document preview
  • Content extraction pipelines

Format conversion:

convertTo=application/pdf asks for a PDF rendering of documents that can be converted. Any other value, and the conversion request for a plain-text file, is ignored: the original file is returned.

Access: the caller needs access to the record (any role on its knowledge base). Without it, and for a record in the trash, the answer is 403. An unknown record, or an id that is not a record (a knowledge base id), is 404. A folder has no content: the answer is 502.

Errors that come from the connector service are relayed with its status as {"error": "<message>"} (StreamRecordErrorResponse); errors raised by the gateway itself (400, 401, scope 403, malformed body 500) use ErrorResponse.

Request: unknown query parameters are ignored.

get/knowledgeBase/stream/record/{recordId}

Request

  • Base URL
    https://app.pipeshub.com/api/v1
  • URL
    https://app.pipeshub.com/api/v1/knowledgeBase/stream/record/{recordId}
  • Auth
    • HTTP bearer
    • or OAuth 2
      Authorization code: /api/v1/oauth2/authorize
      Client credentials
      Token URL: /api/v1/oauth2/token scopes: kb:read

Path parameters

recordIdstring required

Record ID

Query parameters

convertTostring

Target format for conversion. Only application/pdf has an effect, and only for documents that can be converted. Sending it more than once is refused with 400.

versioninteger

Registry version to pin ARTIFACT record content to. Omit to stream the latest version. Ignored for non-artifact records. Must be written as digits only; anything else (-1, 1.5, an empty value) or sending it more than once is refused with 400.

Response

The file's content, with the file's own MIME type (text/plain, text/markdown, text/csv, text/html and application/json for the text files uploads produce; any other stored type is passed through as well). A JSON file is sent exactly as it was uploaded.

Changes

    • breaking

      added to the response body oneOf list for the response status

    • breaking

      the response's body type changed from object to no type for status

    • breaking

      removed the required property from the response with the status

    • info

      added the non-success response with the status

    • info

      added the new optional query request parameter version