GET
/
v1
/
customer-portal
/
downloadables
/
Typescript (SDK)
import { Polar } from "@polar-sh/sdk";

const polar = new Polar();

async function run() {
  const result = await polar.customerPortal.downloadables.list({
    customerSession: process.env["POLAR_CUSTOMER_SESSION"] ?? "",
  }, {
    organizationId: "1dbfc517-0bbf-4301-9ba8-555ca42b9737",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();
{
  "items": [
    {
      "id": "<string>",
      "benefit_id": "<string>",
      "file": {
        "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",
        "download": {
          "url": "<string>",
          "headers": {},
          "expires_at": "2023-11-07T05:31:56Z"
        },
        "version": "<string>",
        "is_uploaded": true,
        "service": "downloadable",
        "size_readable": "<string>"
      }
    }
  ],
  "pagination": {
    "total_count": 123,
    "max_page": 123
  }
}

Authorizations

Authorization
string
header
required

Customer session tokens are specific tokens that are used to authenticate customers on your organization. You can create those sessions programmatically using the Create Customer Session endpoint.

Query Parameters

organization_id

Filter by organization ID. The organization ID.

Examples:

"1dbfc517-0bbf-4301-9ba8-555ca42b9737"

benefit_id

Filter by benefit ID. The benefit ID.

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

Successful Response

items
DownloadableRead · object[]
required
pagination
object
required