declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$fileUploadCompleted = new Components\FileUploadCompleted(
id: '<id>',
path: '/boot',
parts: [
new Components\S3FileUploadCompletedPart(
number: 979613,
checksumEtag: '<value>',
checksumSha256Base64: '<value>',
),
],
);
$response = $sdk->files->uploaded(
id: '<value>',
fileUploadCompleted: $fileUploadCompleted
);
if ($response->responseFilesUploaded !== null) {
// 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>"
}
Complete a file upload.
Scopes: files:write
declare(strict_types=1);
require 'vendor/autoload.php';
use Polar;
use Polar\Models\Components;
$sdk = Polar\Polar::builder()
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
->build();
$fileUploadCompleted = new Components\FileUploadCompleted(
id: '<id>',
path: '/boot',
parts: [
new Components\S3FileUploadCompletedPart(
number: 979613,
checksumEtag: '<value>',
checksumSha256Base64: '<value>',
),
],
);
$response = $sdk->files->uploaded(
id: '<value>',
fileUploadCompleted: $fileUploadCompleted
);
if ($response->responseFilesUploaded !== null) {
// 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>"
}
You can generate an Organization Access Token from your organization's settings.
The file ID.
File upload completed.
File to be associated with the downloadables benefit.
Was this page helpful?