File Downloads
List Downloadables
Core API
- Checkout
- Checkout Links
- Custom Checkout Fields
- Customers
- Subscriptions
- Orders
- Discounts
- Refunds
- Products
- Benefits
- License Keys
- Files
- Organizations
- Metrics
Customer Portal API
- GETGet Customer
- GETGet Organization
- Sessions
- Subscriptions
- Orders
- License Keys
- File Downloads
Webhook Events
- Customer Events
- Billing Events
- Organization Events
OAuth 2.0 API
- Connect
- Clients
File Downloads
List Downloadables
Scopes: customer_portal:read
customer_portal:write
GET
/
v1
/
customer-portal
/
downloadables
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/operations"
"os"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.Downloadables.List(ctx, operations.CustomerPortalDownloadablesListSecurity{
CustomerSession: os.Getenv("POLAR_CUSTOMER_SESSION"),
}, polargo.Pointer(operations.CreateCustomerPortalDownloadablesListQueryParamOrganizationIDFilterArrayOfStr(
[]string{
"1dbfc517-0bbf-4301-9ba8-555ca42b9737",
},
)), nil, nil, nil)
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>",
"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
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
Filter by organization ID.
Example:
"1dbfc517-0bbf-4301-9ba8-555ca42b9737"
Filter by benefit ID.
Page number, defaults to 1.
Required range:
x > 0
Size of a page, defaults to 10. Maximum is 100.
Required range:
x > 0
Response
200
application/json
Successful Response
The ID of the object.
Available options:
downloadable
, product_media
, organization_avatar
Was this page helpful?
package main
import(
"context"
polargo "github.com/polarsource/polar-go"
"github.com/polarsource/polar-go/models/operations"
"os"
"log"
)
func main() {
ctx := context.Background()
s := polargo.New()
res, err := s.CustomerPortal.Downloadables.List(ctx, operations.CustomerPortalDownloadablesListSecurity{
CustomerSession: os.Getenv("POLAR_CUSTOMER_SESSION"),
}, polargo.Pointer(operations.CreateCustomerPortalDownloadablesListQueryParamOrganizationIDFilterArrayOfStr(
[]string{
"1dbfc517-0bbf-4301-9ba8-555ca42b9737",
},
)), nil, nil, nil)
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>",
"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
}
}