Skip to content

Get a file download URL

client.File.URL(ctx, id) (*FileURLResponse, error)
GET/v1/files/{id}/url

Returns a temporary download URL for the file. Only available for files in COMPLETED status.

Required scope: files:read

Rate limit category: Read

ParametersExpand Collapse
id string

Unique identifier of the file to download.

ReturnsExpand Collapse
type FileURLResponse struct{…}
ExpiresAt string

When the download URL expires.

URL string

Temporary download URL for the file.

Get a file download URL

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"),
  )
  fileURLResponse, err := client.File.URL(context.TODO(), "id")
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", fileURLResponse.ExpiresAt)
}
{
  "expiresAt": "expiresAt",
  "url": "url"
}
Returns Examples
{
  "expiresAt": "expiresAt",
  "url": "url"
}