> ## Documentation Index
> Fetch the complete documentation index at: https://docs.diversion.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Get blob contents

> Get blob contents snapshot. Either one of workspace, branch or commit ID needs to be specified



## OpenAPI

````yaml get /repos/{repo_id}/blobs/{ref_id}/{path}
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/blobs/{ref_id}/{path}:
    get:
      tags:
        - Repository Manipulation
      summary: >-
        Get blob contents snapshot. Either one of workspace, branch or commit ID
        needs to be specified.
      operationId: src.handlersv2.files.get_blob
      parameters:
        - $ref: '#/components/parameters/RepoParam'
        - $ref: '#/components/parameters/RefParam'
        - $ref: '#/components/parameters/PathParam'
      responses:
        '200':
          description: File contents
          content:
            application/octet-stream:
              schema:
                type: string
                format: binary
        '204':
          $ref: '#/components/responses/CustomRedirect'
      security:
        - OAuth2:
            - coreapi/read
        - OAuth2:
            - coreapi/write
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
    RefParam:
      in: path
      name: ref_id
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      required: true
      description: An ID of a workspace, branch or commit.
    PathParam:
      in: path
      name: path
      schema:
        type: string
        format: path
        example: /path/to/file
      required: true
      description: A path to a file inside the repository.
  responses:
    CustomRedirect:
      description: Redirect to file contents
      headers:
        Last-Modified:
          description: HTTP date when the file was last modified
          example: Wed, 21 Oct 2015 07:28:00 GMT
          schema:
            type: string
        Location:
          description: URL to the location of the file
          required: true
          example: >-
            https://s3.amazonaws.com/b4bcacbb847681ac9fc372615a2206a4?X-Amz-Algorithm=AWS4-HMAC-SHA256
          schema:
            type: string
        Expires:
          description: HTTP date when the URL expires
          example: Wed, 21 Oct 2015 07:28:00 GMT
          schema:
            type: string
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````