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

# Get the text of files in a datasource

> Return the raw text of each node of the given files, keyed by file name and node id. Pass chunk_id to limit the result to specific nodes. Max 200 file names.



## OpenAPI

````yaml /deasy-openapi.yml get /v2/datasources/{datasource_id}/file-text
openapi: 3.1.0
info:
  title: Collibra Unstructured API
  description: >
    REST API for Collibra Unstructured.


    ## Authentication


    Every endpoint accepts either HTTP Basic credentials, or a bearer token sent
    together with the

    `X-User-ID` header identifying the user the call runs as.


    ## Base URL


    Your Unstructured deployment, for example
    `https://unstructured.your-company.com/rest/unstructured`.
  version: 0.1.14
servers:
  - url: /rest/unstructured
security:
  - BasicAuth: []
  - BearerAuth: []
    UserIdAuth: []
tags:
  - name: Core
    description: Endpoints for core functionality
  - name: Data
    description: Endpoints for source data
  - name: Metadata
    description: Endpoints for metadata management
  - name: Tags
    description: Endpoints for tag management
  - name: Taxonomy
    description: Endpoints for taxonomy management
  - name: Dataslice
    description: Endpoints for dataslice management
  - name: Progress Tracker
    description: Endpoints for tracking progress
  - name: Classification
    description: Endpoints for classification
  - name: Ingestion
    description: Endpoints for document ingestion
  - name: Workflows
    description: Endpoints for workflow management
  - name: Deduplication
    description: Endpoints for deduplication
paths:
  /v2/datasources/{datasource_id}/file-text:
    get:
      tags:
        - Data Connectors
      summary: Get the text of files in a datasource
      description: >-
        Return the raw text of each node of the given files, keyed by file name
        and node id. Pass chunk_id to limit the result to specific nodes. Max
        200 file names.
      operationId: getDatasourceFileText
      parameters:
        - name: datasource_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Datasource Id
        - name: file_name
          in: query
          required: true
          schema:
            type: array
            items:
              type: string
            minItems: 1
            maxItems: 200
            title: File Name
        - name: chunk_id
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Chunk Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DatasourceFileText'
        '400':
          description: Unable to open the datasource.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '403':
          description: Missing token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '404':
          description: No accessible datasource with that id, or no collection.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Too many requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
        '500':
          description: >-
            Internal Server Error. An unexpected error occurred while processing
            the request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPError'
      x-codeSamples:
        - lang: Python
          source: |
            # pip install deasy-sdk
            import os
            from deasy import DeasyClient

            client = DeasyClient(
                base_url=os.environ["UNSTRUCTURED_CLIENT_BASE_URL"],
                username=os.environ["UNSTRUCTURED_USERNAME"],
                password=os.environ["UNSTRUCTURED_PASSWORD"],
            )

            response = client.data_source.get_file_text(
                "example_datasource_id",
                file_name=["example_file_name"],
            )
            print(response.file_to_nodes_to_text)
components:
  schemas:
    DatasourceFileText:
      properties:
        file_to_nodes_to_text:
          additionalProperties:
            additionalProperties:
              type: string
            type: object
          type: object
          title: File To Nodes To Text
          description: Text of each node, keyed by file name and then node id.
      type: object
      required:
        - file_to_nodes_to_text
      title: DatasourceFileText
    StandardErrorResponse:
      properties:
        statusCode:
          type: integer
          title: Statuscode
          description: HTTP status code, repeated in the body.
        errorCode:
          type: string
          title: Errorcode
          description: Stable, specific, camelCase identifier for this condition.
          examples:
            - tagNotFound
        titleMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Titlemessage
          description: Short human-readable summary of the error class.
        userMessage:
          anyOf:
            - type: string
            - type: 'null'
          title: Usermessage
          description: Message safe to show to an end user.
        errorContext:
          anyOf:
            - type: string
            - type: 'null'
          title: Errorcontext
          description: W3C traceparent for the request that produced this error.
          examples:
            - 00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01
        details:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Details
          description: >-
            Machine-readable payload specific to this errorCode. Present only
            for conditions a client can act on programmatically; the set of keys
            is documented per errorCode and only ever widens.
      type: object
      required:
        - statusCode
        - errorCode
      title: StandardErrorResponse
    HTTPError:
      properties:
        detail:
          type: string
          title: Detail
      type: object
      required:
        - detail
      title: HTTPError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BasicAuth:
      type: http
      scheme: basic
    BearerAuth:
      type: http
      scheme: bearer
    UserIdAuth:
      type: apiKey
      in: header
      name: X-User-ID

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.