Skip to content
Framework Docs

Read File Content

client.Files.Get(ctx, fileID, query) (*PresignedURL, error)
GET/api/v1/beta/files/{file_id}/content

Get a presigned URL to download the file content.

ParametersExpand Collapse
fileID string
query FileGetParams
ExpiresAtSeconds param.Field[int64]optional
OrganizationID param.Field[string]optional
ProjectID param.Field[string]optional
ReturnsExpand Collapse
type PresignedURL struct{…}

Schema for a presigned URL.

ExpiresAt Time

The time at which the presigned URL expires

formatdate-time
URL string

A presigned URL for IO operations against a private file

minLength1
formaturi
FormFields map[string, string]optional

Form fields for a presigned POST request

Read File Content

package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/llamacloud-prod-go"
  "github.com/stainless-sdks/llamacloud-prod-go/option"
)

func main() {
  client := llamacloudprod.NewClient(
    option.WithAPIKey("My API Key"),
  )
  presignedURL, err := client.Files.Get(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    llamacloudprod.FileGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", presignedURL.ExpiresAt)
}
{
  "expires_at": "2019-12-27T18:11:19.117Z",
  "url": "https://example.com",
  "form_fields": {
    "foo": "string"
  }
}
Returns Examples
{
  "expires_at": "2019-12-27T18:11:19.117Z",
  "url": "https://example.com",
  "form_fields": {
    "foo": "string"
  }
}