Endpoint
This endpoint resolves a secure link using its short code. It validates access conditions (expiration, view limits, password) and either redirects to the target URL or returns file content.
Path Parameters
The unique 8-character identifier for the secure link.Format: Alphanumeric string (case-sensitive)Example:
K2x9pLmNHeaders
Password required to access password-protected links.When Required:
- Only needed if the link was created with a password
- Returns 401 Unauthorized if missing or incorrect
mySecurePassword123Controls response format for redirect links.Behavior:
application/json: Returns JSON with redirect URL (status 200)- Any other value or not set: Returns HTTP 302 redirect
REDIRECT type links, not file downloadsExample: application/jsonClient user agent string (automatically sent by browsers).Purpose:
- Captured for audit logging
- Helps track access patterns and detect suspicious activity
Mozilla/5.0 (Windows NT 10.0; Win64; x64)...Response Types
Redirect Link (HTTP 302)
ForREDIRECT type links without Accept: application/json header:
Client is redirected to the target URL.
Contains the target URL for redirection.Example:
https://example.com/document.pdfRedirect Link (JSON)
ForREDIRECT type links with Accept: application/json header:
Always “REDIRECT” for redirect links.
The destination URL.Example:
https://example.com/document.pdfFile Download
ForDOWNLOAD type links (created via file upload):
File content is returned in the response body.
Specifies the original filename for download.Format:
attachment; filename="original-name.pdf"Example: attachment; filename="report-2024.xlsx"Set to
application/octet-stream for binary file downloads.Raw file content as a resource stream.
Status Codes
For JSON requests: Successfully resolved redirect link, JSON response returned.For file downloads: File content returned successfully.
For redirect links: Client is being redirected to the target URL.Access tracking: This access is recorded as successful in audit logs.
Password authentication failed. Possible causes:PASSWORD_REQUIRED:
- Link requires a password but
X-Link-Passwordheader was not provided - Error message: “Password required”
- Password provided in
X-Link-Passwordheader is incorrect - Error message: “Invalid password”
Link does not exist or file is missing. Possible causes:NOT_FOUND (link):
- No link exists with the provided short code
- Error message: “Link not found”
- Link exists but the associated file has been deleted from storage
- Error message: “File not found”
Link has been invalidated. Possible causes:REVOKED:
- Link was manually revoked via DELETE /l/
- Error message: “Link has been revoked”
- Link has reached its maximum view count
- Link is automatically marked as revoked
- Error message: “Link has reached its view limit”
- Current time is past the link’s expiration timestamp
- Error message: “Link has expired”
Unexpected server error occurred.Error response includes:
timestamp: When the error occurredstatus: HTTP status code (500)error: “Internal Server Error”message: Generic error message with reference IDpath: Request path that caused the error
Validation & Security Checks
The endpoint performs the following checks in order:- Link Existence: Verify link with short code exists (404 if not)
- Revocation Status: Check if link has been manually revoked (410 if revoked)
- Password Validation: If password is set, validate header (401 if missing/wrong)
- View Limit: Check if maxViews exceeded (410 if limit reached, auto-revokes)
- Expiration: Check if current time > expiresAt (410 if expired)
- File Existence (downloads only): Verify file exists on disk (404 if missing)
- Increment View Counter: Increment current view count for successful access
- Audit Logging: Record access attempt with result, IP, user agent
Examples
Access Basic Redirect Link
Access Password-Protected Link
Download File
Error: Link Not Found
Request:Error: Password Required
Request (missing password header):Error: Invalid Password
Request (wrong password):Error: Link Revoked
Request:Error: View Limit Reached
Request (link has reached max views):When a link reaches its view limit, it is automatically marked as revoked to prevent further access attempts.
Error: Link Expired
Request (current time past expiresAt):Access Tracking
Every access attempt (successful or failed) is recorded in the audit log with:- Short Code: Link identifier
- Access Result:
SUCCESS,NOT_FOUND,REVOKED,PASSWORD_REQUIRED,INVALID_PASSWORD,VIEW_LIMIT_REACHED,EXPIRED - IP Address: Client IP address (from
HttpServletRequest.getRemoteAddr()) - User Agent: Client user agent string
- Timestamp: When the access occurred
Important Notes
Password Security: Passwords are validated using bcrypt comparison. The plaintext password in the
X-Link-Password header is never stored or logged.IP & User Agent Tracking: All access attempts capture client IP and user agent for security auditing and analytics purposes.
Related Endpoints
Create Link
Create a new secure redirect link
Upload Link
Upload a file and create a download link
Revoke Link
Manually revoke a secure link
Access Statistics
View access patterns and metrics
