File Sharing Link¶

This API allows you to create a unique link to share content hosted on you Freebox.

NOTE: this feature is available only if you enable HTTP remote access to your Freebox.

File Sharing Errors¶

When attempting to access the file sharing API, you may encounter the following errors:

error_code Description
invalid_id Invalid object id
path_not_found File or folder not found
internal_error Internal error

File Sharing Link object¶

Share link have the following attributes:

ShareLink¶
token string Read-only¶

The link unique sharing token

path string Read-only¶

The root path of the share, if the path is a regular file, only this file will be shared

name string Read-only¶

The readable name of the shared file/folder

expire timestamp Read-only¶

Link expiration timestamp, 0 means no expiration.

fullurl string Read-only¶

Full URL to use for remote access. If remote access is disabled, the field will be empty.

File Sharing Link API¶

Retrieve a File Sharing link¶

GET /api/v4/share_link/¶

Returns the collection of all ShareLink

Example request:

GET /api/v4/share_link/ HTTP/1.1
Host: mafreebox.freebox.fr

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
   success: true,
   result: [
      {
          "path": "L0Rpc3F1ZSBkdXIvUGhvdG9zL01lcyB2YWNhbmNlcyBlbiByb3Vsb3R0ZQ==" /* /Disque dur/Photos/Mes vacances en roulotte */
          "name": "Mes vacances en roulotte",
          "token": "gAnweF2Xg5OwcJWn",
          "expire": 1355852344,
          "fullurl": "http://13.37.42.69/api/v4/share/gAnweF2Xg5OwcJWn/"
      },
      {
          "path": "L0Rpc3F1ZSBkdXIvc2hhcmVk", /* /Disque dur/shared */
          "name": "shared",
          "token": "s8a+4VtOQNkkQ55f",
          "expire": 1355866268,
          "fullurl": "http://13.37.42.69/api/v4/share/s8a+4VtOQNkkQ55f/"
      }
   ]
}
GET /api/v4/share_link/{token}¶

Returns the ShareLink task with the given id

Example request:

GET /api/v4/share_link/gAnweF2Xg5OwcJWn HTTP/1.1
Host: mafreebox.freebox.fr

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true,
    "result": {
        "path": "L0Rpc3F1ZSBkdXIvUGhvdG9zL01lcyB2YWNhbmNlcyBlbiByb3Vsb3R0ZQ==" /* /Disque dur/Photos/Mes vacances en roulotte */
        "name": "Mes vacances en roulotte",
        "token": "gAnweF2Xg5OwcJWn",
        "expire": 1355852344,
        "fullurl": "http://13.37.42.69/api/v4/share/gAnweF2Xg5OwcJWn/"
    }
}

Delete a File Sharing link¶

DELETE /api/v4/share_link/{token}¶

Deletes the ShareLink task with the given token, if the task was running, stop it.

No rollback is done, if a file as already been processed it will be left as is.

Example request:

DELETE /api/v4/share_link/gAnweF2Xg5OwcJWn HTTP/1.1
Host: mafreebox.freebox.fr

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true
}

Create a File Sharing link¶

POST /api/v4/share_link/¶

Create a new ShareLink

Example request:

POST /api/v4/share_link/ HTTP/1.1
Host: mafreebox.freebox.fr
{
   "path": "L0Rpc3F1ZSBkdXIvVMOpbMOpY2hhcmdlbWVudHM=", /* /Disque dur/Téléchargements */
   "expire": 1355932880,
   "fullurl": ""
}

Example response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
    "success": true,
    "result": {
        "path": "L0Rpc3F1ZSBkdXIvVMOpbMOpY2hhcmdlbWVudHM=", /* /Disque dur/Téléchargements */
        "name": "Téléchargements",
        "token": "6Hj57zgTfoQqb_vH",
        "expire": 1355932880,
        "fullurl": "http://13.37.42.69/api/v4/share/6Hj57zgTfoQqb_vH/"
    }
}