POST
/
v1
/
files
/
{id}
/
uploaded
package main

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

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

    res, err := s.Files.Uploaded(ctx, "<value>", components.FileUploadCompleted{
        ID: "<id>",
        Path: "/sys",
        Parts: []components.S3FileUploadCompletedPart{
            components.S3FileUploadCompletedPart{
                Number: 173116,
                ChecksumEtag: "<value>",
                ChecksumSha256Base64: polargo.String("<value>"),
            },
            components.S3FileUploadCompletedPart{
                Number: 894030,
                ChecksumEtag: "<value>",
                ChecksumSha256Base64: polargo.String("<value>"),
            },
            components.S3FileUploadCompletedPart{
                Number: 673715,
                ChecksumEtag: "<value>",
                ChecksumSha256Base64: polargo.String("<value>"),
            },
        },
    })
    if err != nil {
        log.Fatal(err)
    }
    if res.ResponseFilesUploaded != nil {
        // handle response
    }
}
{
  "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>"
}

Authorizations

Authorization
string
header
required

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

Path Parameters

id
string
required

The file ID.

Body

application/json
id
string
required
path
string
required
parts
object[]
required

Response

200
application/json
File upload completed.

File to be associated with the downloadables benefit.

id
string
required

The ID of the object.

organization_id
string
required
name
string
required
path
string
required
mime_type
string
required
size
integer
required
storage_version
string | null
required
checksum_etag
string | null
required
checksum_sha256_base64
string | null
required
checksum_sha256_hex
string | null
required
last_modified_at
string | null
required
version
string | null
required
service
string
required
Allowed value: "downloadable"
is_uploaded
boolean
required
created_at
string
required
size_readable
string
required

Was this page helpful?