Read public share links
Read the files of an Assets share link from a program, including links protected by a password.
Read a public share link
A public share link is created in Nucleo (in Assets, Share > Public link) and opens its files to anyone who has it, without a Nucleo account or an API key: the token in the link is the access. The share page your recipients see reads the files with these calls, and a program can do the same (base https://api-catalog.nucleoplatform.com/api/dam/v1):
| Call | What it returns |
|---|---|
GET /share/{token} | Title, note, downloadEnabled, expiresAt and the list of files (id, title, kind, filename, mime, bytes). |
GET /share/{token}/files/{id}/rendition/{filename} | One file. On a preview-only link (downloadEnabled: false) only reduced previews, with ?w= up to 640 pixels; anything else is 403. |
GET /share/{token}/download | All the files in a zip; 403 on a preview-only link. |
POST /share/{token}/unlock | A session for a password-protected link (see below). |
An unknown token answers 404, an expired link 410. Each address can make 600 requests a minute to one link.
Open a password-protected link
Until you prove the password, every call on a protected link answers 401 with code: password_required and passwordRequired: true. The password goes only in a header or in the body of unlock, never in the URL:
- Session (recommended).
POST /share/{token}/unlockwith{"password": "…"}returnsdata.sessionanddata.maxAge(3600 seconds). Send it asX-Share-Sessionon the next calls, file and zip downloads included. It is valid for one hour and only for that link, and changing the link's password ends it. - Header.
X-Share-Password: <password>on each call. Every call counts as an attempt, so prefer the session for more than one call.
SESSION=$(curl -s -X POST https://api-catalog.nucleoplatform.com/api/dam/v1/share/$TOKEN/unlock \
-H "Content-Type: application/json" \
-d '{"password": "the password you received"}' | jq -r .data.session)
curl https://api-catalog.nucleoplatform.com/api/dam/v1/share/$TOKEN \
-H "X-Share-Session: $SESSION"The password in the query string (?password=) is no longer accepted: the call answers 401 password_required as if no password had been sent. A password in a URL ends up in access logs, in the browser history and in the Referer header.
Wrong passwords are limited. A link accepts 10 wrong passwords a minute from the same address and 50 an hour from all addresses together. Past either limit it answers 429 too_many_attempts with Retry-After (in seconds) — even to the right password — until the window ends. Calls with a valid X-Share-Session are not affected, so whoever already unlocked the link keeps working.