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
- Path parameters
| Parameter | Description |
|---|---|
fileId | The ID of the file. |
- Request fields
| Path | Type | Description |
|---|---|---|
ttlSec | Number | Time to live of the public link |
password | String | Password for the public link |
isCorporate | Boolean | Flag that public link is corporate |
type | PublikLinkType | Type of public link main or mail |
- 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"
}'
- 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"
}