Shared links
Riversoft® STCP DirectLink can deliver a file to a recipient through a secure link, without the recipient starting a session. GET /download processes the link, which can require a PIN.
sequenceDiagram
participant C as Client
participant A as Riversoft STCP DirectLink API
participant D as Recipient
C->>A: GET secure link from /download/pin
A-->>D: Notification with the PIN
A-->>C: 200 OK with linkURL to /download
D->>A: GET linkURL with p=PIN
A-->>D: File content
Download through a secure link
Open the full link you received. It already contains the parameters that identify the file, the user, and the expiration time.
By default, the download link is valid for 24 hours and the PIN for 180 seconds. The environment administrator can change these periods.
Send the PIN in the p parameter:
export SECURE_DOWNLOAD_URL='<full link received for /download>'
read -r -s -p 'Download PIN: ' DOWNLOAD_PIN; printf '\n'
curl -L --fail -G \
--data-urlencode "p=$DOWNLOAD_PIN" \
--output ./downloaded-file \
"$SECURE_DOWNLOAD_URL"Request the PIN
GET /download/pin starts the PIN-protected delivery from a secure link issued by the service. The API:
- generates a PIN;
- sends the PIN to the configured recipient;
- returns a
linkURLto continue at/download.
export DOWNLOAD_PIN_REQUEST_URL='<secure link issued to start the PIN delivery>'
curl -i "$DOWNLOAD_PIN_REQUEST_URL"Response:
{
"status": 0,
"description": "<description returned by the API>",
"apiver": "v2 (9.0.1)",
"email": "<recipient email>",
"phone": "<recipient phone>",
"file": "<file name>",
"linkURL": "<secure download link>",
"time": "<date and time>"
}With the PIN received, the recipient follows linkURL as described in Download through a secure link.
Warning
Secure links expire and are bound to the file and the recipient. Do not build or change their signed parameters, and forward them only to the authorized recipient.
Full contract in Reference: Transfers.