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_enabledbool¶ is file sharing enabled
-
print_share_enabledbool¶ is printer sharing enabled
-
logon_enabledbool¶ is login/password required to access shares
-
logon_userstring¶ samba user name
-
logon_passwordstring Write-only¶ samba user password
-
workgroupstring¶ name of the workgroup
-
Samba config API¶
Get the current Samba configuration¶
-
GET/api/v4/netshare/samba/¶ Get the
SambaConfigExample 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
SambaConfigExample 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¶ -
enabledbool¶ is afp service enabled
-
guest_allowbool¶ allow guest to access shared files
-
server_typeenum¶ 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_namestring¶ Afp user name
-
login_passwordstring Write-only¶ Afp user password
-
Afp config API¶
Get the current Afp configuration¶
-
GET/api/v4/netshare/afp/¶ Get the
AfpConfigExample 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
AfpConfigExample 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" } }