GET
/
v1
/
files
package main

import(
	"context"
	"os"
	polargo "github.com/polarsource/polar-go"
	"log"
)

func main() {
    ctx := context.Background()
    
    s := polargo.New(
        polargo.WithSecurity(os.Getenv("POLAR_ACCESS_TOKEN")),
    )

    res, err := s.Files.List(ctx, nil, nil, nil, nil)
    if err != nil {
        log.Fatal(err)
    }
    if res.ListResourceFileRead != nil {
        for {
            // handle items

            res, err = res.Next()

            if err != nil {
                // handle error
            }

            if res == nil {
                break
            }
        }
    }
}
{
  "items": [
    {
      "id": "<string>",
      "organization_id": "<string>",
      "name": "<string>",
      "path": "<string>",
      "mime_type": "<string>",
      "size": 123,
      "storage_version": "<string>",
      "checksum_etag": "<string>",
      "checksum_sha256_base64": "<string>",
      "checksum_sha256_hex": "<string>",
      "last_modified_at": "2023-11-07T05:31:56Z",
      "version": "<string>",
      "service": "<string>",
      "is_uploaded": true,
      "created_at": "2023-11-07T05:31:56Z",
      "size_readable": "<string>"
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

organization_id
string | null

The organization ID.

ids
string[] | null

List of file IDs to get.

page
integer
default:
1

Page number, defaults to 1.

Required range: x > 0
limit
integer
default:
10

Size of a page, defaults to 10. Maximum is 100.

Required range: x > 0

Response

200
application/json
Successful Response
items
object[]
required
pagination
object
required

Was this page helpful?