File Link API

This API is available from version 9.0 or above of PowerFolder server.

Using the File link API you can create links to files.

Please read the main article about the API to understand how it works.

Using the File Link API

The service is available at the URI: /getlink

Example

https://powerfolder.example.com/getlink/<folderID>

The <folderID> has to be Base64 encoded.

Overview

Actions supported by the File Link API

Action: store

Requires folder admin permission 


This action stores a file link with specified properties.

ParameterMandatoryDescriptionExample
actionYesMust always be storestore
publicAccessNoDefines if the link is public or not.
false
linkValidTillNoDefines how long a link can be used(dd MMM yyyy)04 AUG 2015
maxDownloadsNo

Defines how many times a link can be used to download a file

5
jsonNoDefines if the response is in JSON format1

 

Example

https://powerfolder.example.com/getlink/VGhpcyBpcyBub3QgYSB2YWxpZCBGb2xkZXIgSUQ=/dir/dir2/text.txt?action=store&publicAccess=false&linkValidTill=04%20AUG%202014&maxDownloads=20

If json was set to 1:

Return value
{
	"url" : "http://office.powerfolder.net:8081/getlink/fi6HLSxyYBfFuqpcXb98zSYR/"
}

Action: remove

This action removes a file link

ParameterMandatoryDescriptionExample
actionYesMust always be removeremove
jsonNoDefines if the response is in JSON format1


Example

https://powerfolder.example.com/getlink/VGhpcyBpcyBub3QgYSB2YWxpZCBGb2xkZXIgSUQ=/dir/dir2/text.txt?action=remove

If json was set to 1:

Return value
{
	"message" : "Removed file link fi6HLSxyYBfFuqpcXb98zSYR/ by admin @ 88.78.156.194"
}

Action: invite

This action stores a file link with specified properties.

ParameterMandatoryDescriptionExample
actionYesMust always be storeinvite
inviteeYesThe user that should be invited
user123
messageNoA message that will be sent to the inviteeHey there, here's my file

 

Example

https://powerfolder.example.com/getlink/VGhpcyBpcyBub3QgYSB2YWxpZCBGb2xkZXIgSUQ=/dir/dir2/text.txt?action=invite&invitee=powerfolder@example.com

If json was set to 1:

Return value
{
	"message" : "The link was successfully sent"
}

Returns a download link for a stored link

ParameterMandatoryDescriptionExample
jsonNoDefines if the response is in JSON format1

 

Example

https://powerfolder.example.com/getlink/VGhpcyBpcyBub3QgYSB2YWxpZCBGb2xkZXIgSUQ=/dir/dir2/text.txt

 

If json was set to 1:

Return value
{
	"url" : "http://office.powerfolder.net:8081/getlink/fi6HLSxyYBfFuqpcXb98zSYR/"
}