Downloads API¶
Endpoints for generating download URLs and share links.
Get Download URL¶
Generate a pre-signed URL to download a file.
Query Parameters¶
| Parameter | Type | Required | Description |
|---|---|---|---|
applicationId |
string | Yes | The application ID |
version |
string | Yes | The version string |
fileId |
string | No | Specific file ID (for multi-file versions) |
URL Expiration
Download URLs expire after 30 minutes. Generate a new URL if the download doesn't complete in time.
Example Request¶
Example Response¶
{
"success": true,
"data": {
"downloadUrl": "https://s3.eu-central-1.amazonaws.com/bindist-apps/...",
"expiresAt": "2025-01-15T12:30:00Z",
"fileName": "my-app-2.1.0.exe",
"fileSize": 15728640,
"checksum": "sha256:e3b0c44298fc1c149afbf4c8996fb924..."
}
}
Downloading the File¶
The SDKs wrap "get URL → GET pre-signed URL → write bytes" into a single call. With curl, do it in two steps:
// Into memory, with optional SHA256 checksum verification
content, metadata, err := client.DownloadFile(ctx, "my-app", "2.1.0", "", true)
os.WriteFile(metadata.FileName, content, 0644)
// Stream straight to disk (good for large files)
f, _ := os.Create("my-app-2.1.0.exe")
defer f.Close()
metadata, err = client.DownloadFileToWriter(ctx, "my-app", "2.1.0", "", f)
import { writeFileSync } from 'fs';
const info = await client.getDownloadInfo('my-app', '2.1.0');
const buffer = await client.downloadFile(info.data.downloadUrl);
writeFileSync('my-app-2.1.0.exe', Buffer.from(buffer));
// For large files, prefer the streaming variant:
const stream = await client.downloadFileStream(info.data.downloadUrl);
Error Responses¶
Version Not Found (404)
Tier Access Denied (403)
{
"success": false,
"error": {
"code": "FORBIDDEN",
"message": "This version requires Premium tier access"
}
}
Create Share Link¶
Create a shareable download link that can be used without authentication.
Request Body¶
| Field | Type | Required | Description |
|---|---|---|---|
applicationId |
string | Yes | The application ID |
version |
string | Yes | The version string |
fileId |
string | No | Specific file ID |
expiresInMinutes |
number | No | Expiration time (default: 30, max: 1440) |
Example Request¶
Example Response¶
{
"success": true,
"data": {
"shareUrl": "https://api.bindist.eu/v1/downloads/share/tok_abc123xyz",
"expiresAt": "2025-01-15T13:00:00Z",
"token": "tok_abc123xyz"
}
}
Use Cases for Share Links
- Send download links to users without API keys
- Embed in emails or documentation
- Time-limited access for testing or demos