Collections and share links
Group assets into collections and share files, folders, and collections with people outside your workspace using share links.
Collections group assets from anywhere in a drive without moving them. Share links let people outside your workspace view, comment on, or download files and folders. This guide covers both through the API.
Prerequisites
A Shade API key, stored in the
SHADE_KEYenvironment variableA drive ID. See Finding your IDs
To create share links, the Share permission on the files you're sharing
Base information
Base URL:
https://api.shade.incAuthentication: your API key in the
Authorizationheader, with noBearerprefixPaths start with the drive ID, for example
/YOUR_DRIVE_ID/Fall Campaign/Deliverables
1. Create a collection
curl -X POST "https://api.shade.inc/collections" \
-H "Authorization: $SHADE_KEY" \
-H "Content-Type: application/json" \
-d '{
"drive_id": "YOUR_DRIVE_ID",
"name": "Fall Campaign selects",
"description": "Best takes for the edit"
}'The response is the new collection's ID as a JSON string:
List a drive's collections with GET /collections?drive_id=YOUR_DRIVE_ID.
2. Add assets
Add assets by ID, or add every asset under a folder:
Remove assets with DELETE /collections/{collection_id}/assets and a body of {"asset_ids": [...]}. The files themselves stay where they are.
3. List what's in a collection
Search with collection_id to page through a collection's assets. This also lets you filter and sort within it:
See Searching and filtering assets for every filter and how to page through results.
4. Create a share link
Share links point at a file or folder. Pick what viewers can do with allowed_actions:
read
View files and previews
comment
Leave comments
download
Download files
Optional settings:
password
Viewers must enter this password
expiration_date
The link stops working after this time, in ISO 8601
max_view_count
The link stops working after this many unique viewers
The response includes the share link's id. Send viewers to:
5. Manage share links
List links for a file or folder
GET /workspaces/drives/{drive_id}/public-file-shares?path=...
List every link in a drive
GET /workspaces/drives/{drive_id}/drive-shared-links
Change a link
PUT /workspaces/drives/{drive_id}/public-file-shares/{share_id}
Delete a link
DELETE /workspaces/drives/{drive_id}/public-file-shares/{share_id}
PUT takes the same fields as creating a link, and is_public_enabled and allowed_actions are required. Set is_public_enabled to false to turn a link off without deleting it. To remove a password, send "removed_password": true.
Each link reports is_expired and is_view_limit_reached, so you can find links that have stopped working.
6. Share a collection
Collections are shared through their own settings rather than a separate share link. Update the collection with is_public_enabled, allowed_actions, and optionally password and expiration_date:
The collection's link is https://app.shade.inc/collection/INVITE_ID, using the invite_id from GET /collections/{collection_id}.
Tips
Give every share link a clear
name. It's what you'll see when listing a drive's links later.Use
expiration_dateormax_view_countfor client deliveries, so links don't stay open forever.Share a collection rather than a folder when the files you want to send live in different folders.
Related
Last updated
Was this helpful?

