Network Share¶
The network share API allow you to control the file sharing services running on the Freebox.
Network Share Errors¶
When attempting to access this API, you may encounter the following errors:
error_code | Description |
---|---|
invalid_workgroup_name | Invalid workgroup name |
invalid_logon_user | Invalid samba user name |
invalid_logon_password | Invalid samba user password |
invalid_afp_login_name | Invalid AFP user name |
invalid_afp_login_password | Invalid AFP user password |
Samba Config¶
SambaConfig has the following attributes:
-
SambaConfig
¶ -
file_share_enabled
bool¶ is file sharing enabled
-
print_share_enabled
bool¶ is printer sharing enabled
-
logon_enabled
bool¶ is login/password required to access shares
-
logon_user
string¶ samba user name
-
logon_password
string Write-only¶ samba user password
-
workgroup
string¶ name of the workgroup
-
Samba config API¶
Get the current Samba configuration¶
-
GET
/api/v4/netshare/samba/
¶ Get the
SambaConfig
Example request:
GET /api/v4/netshare/samba/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "workgroup": "WORKGROUP", "print_share_enabled": true, "file_share_enabled": true, "logon_enabled": false, "logon_user": "freebox" } }
Update the Samba configuration¶
-
PUT
/api/v4/netshare/samba/
¶ Update the
SambaConfig
Example request:
PUT /api/v4/netshare/samba/ HTTP/1.1 Host: mafreebox.freebox.fr
{ "print_share_enabled": false }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "workgroup": "WORKGROUP", "print_share_enabled": false, "file_share_enabled": true, "logon_enabled": false, "logon_user": "freebox" } }
Afp Config¶
AfpConfig has the following attributes:
-
AfpConfig
¶ -
enabled
bool¶ is afp service enabled
-
guest_allow
bool¶ allow guest to access shared files
-
server_type
enum¶ Afp server type (to display proper icon) in MacOS
valid server types are:
server_type powerbook powermac macmini imac macbook macbookpro macbookair macpro appletv airport xserve
-
login_name
string¶ Afp user name
-
login_password
string Write-only¶ Afp user password
-
Afp config API¶
Get the current Afp configuration¶
-
GET
/api/v4/netshare/afp/
¶ Get the
AfpConfig
Example request:
GET /api/v4/netshare/afp/ HTTP/1.1 Host: mafreebox.freebox.fr
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": false, "guest_allow": true, "login_name": "freebox", "server_type": "airport" } }
Update the Afp configuration¶
-
PUT
/api/v4/netshare/afp/
¶ Update the
AfpConfig
Example request:
PUT /api/v4/netshare/afp/ HTTP/1.1 Host: mafreebox.freebox.fr
{ "guest_allow": false }
Example response:
HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8
{ "success": true, "result": { "enabled": false, "guest_allow": false, "login_name": "freebox", "server_type": "airport" } }