Skip to main content

Create new public link

note

[Since 2021.03]

A request to create new public link for the file with desired ttl.

POST /api/v1/files/{fileId}/public HTTP/1.1
  1. Path parameters
ParameterDescription
fileIdThe ID of the file.
  1. Request fields
PathTypeDescription
ttlSecNumberTime to live of the public link
passwordStringPassword for the public link
isCorporateBooleanFlag that public link is corporate
typePublikLinkTypeType of public link main or mail
  1. Example request
curl 'http://localhost:8080/api/v1/files/189418715/public' -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-co-auth-token: 4eb317e6cf28d7081415de717006cc20' \
-d '{
"ttlSec" : 3600,
"password" : "Passw0rd!",
"isCorporate" : false,
"type" : "main"
}'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 48355867527a6b676f6c4a466a503076
Content-Type: application/vnd.ncloudtech.cloudoffice.publiclink+json;v=1;charset=UTF-8
Content-Length: 245
{
"url": "http://localhost:8080/public/dbe130bf-ad3f-4ba4-9220-068e34757553",
"password": "Passw0rd!",
"uid": "dbe130bf-ad3f-4ba4-9220-068e34757553",
"startTime": "2022-04-06T16:02:43.000Z",
"endTime": "2022-04-06T17:02:43.000Z",
"type": "main"
}