Skip to content

List files

client.File.List(ctx, query) (*FileListResponse, error)
GET/v1/files

Returns a paginated list of files in your workspace. Use offset and limit to paginate through results. See List endpoints for more information about pagination.

Required scope: files:read

Rate limit category: Search

ParametersExpand Collapse
query FileListParams
Limit param.Field[int64]Optional

Maximum number of records to return. Defaults to 25, maximum 25.

minimum1
maximum9007199254740991
Offset param.Field[int64]Optional

Number of records to skip for pagination. Defaults to 0.

minimum0
maximum9007199254740991
ReturnsExpand Collapse
type FileListResponse struct{…}
Data []FileListResponseData

Array of file objects for the current page.

ID string

Unique identifier for the file.

CompletedAt string

When the file upload was completed.

CreatedAt string

When the file upload session was created.

ExpiresAt string

When the upload session expires. Null once completed, cancelled, or expired.

Filename string

Original filename.

MimeType string

MIME type of the file.

SizeBytes int64

File size in bytes.

minimum-9007199254740991
maximum9007199254740991
Status string

Current upload status of the file.

One of the following:
const FileListResponseDataStatusPending FileListResponseDataStatus = "PENDING"
const FileListResponseDataStatusCompleted FileListResponseDataStatus = "COMPLETED"
const FileListResponseDataStatusCancelled FileListResponseDataStatus = "CANCELLED"
const FileListResponseDataStatusExpired FileListResponseDataStatus = "EXPIRED"
Object string

The object type, always "list".

TotalCount int64

Total number of matching files.

minimum0
maximum9007199254740991

List files

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  fileListResponse, err := client.File.List(context.TODO(), githubcomlightfldlightfieldgo.FileListParams{

  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", fileListResponse.Data)
}
{
  "data": [
    {
      "id": "id",
      "completedAt": "completedAt",
      "createdAt": "createdAt",
      "expiresAt": "expiresAt",
      "filename": "filename",
      "mimeType": "mimeType",
      "sizeBytes": -9007199254740991,
      "status": "PENDING"
    }
  ],
  "object": "object",
  "totalCount": 0
}
Returns Examples
{
  "data": [
    {
      "id": "id",
      "completedAt": "completedAt",
      "createdAt": "createdAt",
      "expiresAt": "expiresAt",
      "filename": "filename",
      "mimeType": "mimeType",
      "sizeBytes": -9007199254740991,
      "status": "PENDING"
    }
  ],
  "object": "object",
  "totalCount": 0
}