Scopes: customer_portal:read customer_portal:write
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"os"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.Downloadables.List(ctx, operations.CustomerPortalDownloadablesListSecurity{
CustomerSession: os.Getenv("POLAR_CUSTOMER_SESSION"),
}, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceDownloadableRead != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"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>",
"expires_at": "2023-11-07T05:31:56Z",
"headers": {}
},
"version": "<string>",
"is_uploaded": true,
"service": "downloadable",
"size_readable": "<string>"
}
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}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.
Filter by benefit ID.
Page number, defaults to 1.
Size of a page, defaults to 10. Maximum is 100.
Successful Response
Show child attributes
Show child attributes
The ID of the object.
downloadable, product_media, organization_avatar Was this page helpful?
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"os"
"github.com/polarsource/polar-go/models/operations"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.Downloadables.List(ctx, operations.CustomerPortalDownloadablesListSecurity{
CustomerSession: os.Getenv("POLAR_CUSTOMER_SESSION"),
}, nil, polargo.Pointer[int64](1), polargo.Pointer[int64](10))
if err != nil {
log.Fatal(err)
}
if res.ListResourceDownloadableRead != nil {
for {
// handle items
res, err = res.Next()
if err != nil {
// handle error
}
if res == nil {
break
}
}
}
}{
"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>",
"expires_at": "2023-11-07T05:31:56Z",
"headers": {}
},
"version": "<string>",
"is_uploaded": true,
"service": "downloadable",
"size_readable": "<string>"
}
}
],
"pagination": {
"total_count": 123,
"max_page": 123
}
}