This API endpoint allows users to share a file by generating a unique, shareable link for the specified file.

Request

POST http://localhost:3000/files/:id/share

Replace :id with the file ID you want to share.

Headers

Example

cURL


curl --location --request POST '<http://localhost:3000/files/5/share>' \\
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJleHAiOjE2ODAwMDkwNDZ9.K8jBFmAruSMW4MGWCmQJ5MIwxaQ-O9E0Aehsi4GOpPc'

Response

Success


{
    "share_link": "<https://d237198xeojlsg.cloudfront.net/share/RNrKNzPNmbasJQn38RwxuF_XDQw>"
}

Error


{
    "error": "File not found."
}

Error