Create a Weblink#
Builds a new weblink for a given directory or file.
POST https://api.cloudplan.net/api/weblink/create
Request Parameters#
{
"folder_id": "",
"file_id": "",
"file_name": "",
"pw": "",
"duration": 0,
"max_downloads": 0
}
folder_id | (string)
Id of the folder to link, or the folder that contains the linked file.
file_id | (optional) (string)
Id of the file to link. Only optional when a directory is linked, when a file is linked it is mandatory
default: empty
file_name | (optional) (string)
Name of the file it links to. Only optional when a directory is linked, when a file is linked it is mandatory
default: empty
pw | (optional) (string)
Password for the link
default: empty
duration | (optional) (integer)
Time in second after which the weblink becomes invalid.
default: 86400
Possible values:
‘86400’ => language(‘1 day’),
‘172800’ => language(‘2 days’),
‘259200’ => language(‘3 days’),
‘345600’ => language(‘4 days’),
‘432000’ => language(‘5 days’),
‘604800’ => language(‘1 week’),
‘1209600’ => language(‘2 weeks’),
‘1814400’ => language(‘3 weeks’),
‘2419200’ => language(‘4 weeks’),
‘2592000’ => language(‘1 month’),
‘4838400’ => language(‘8 weeks’),
‘5184000’ => language(‘2 month’),
‘99999999999’ => language(‘infinite’),
max_downloads | (optional) (integer)
The link becomes invalid after this number of downloads.
default: infinite
Examples#
Minimal Example JSON Request
This request creates a weblink for a directory with default settings.
{
"folder_id": "6960D3994737607552574B980961708E"
}
Full Example JSON Request
This creates a password protected weblink for a file with a duration of 2 days after which the link becomes invalid and limits downloads to 10.
{
"folder_id": "6960D3994737607552574B980961708E",
"file_id": "6960E107DEC531B66786291E130EFA38",
"file_name": "logo.png",
"pw": "test123",
"duration": 172800,
"max_downloads": 10
}
{
"link_id": "696E28C84F7883764A04E9594C5035CF",
"result": true
}
Resulting url would be: https://portal.cloudplan.net/app/wl/logo.png/696E28C84F7883764A04E9594C5035CF/