Authentication

Note: Ensure you're using HTTPS on port 82 with admin credentials (admin / admin).


1. ✅ Create SMB Share

POST https://<nas-ip>:82/api/v4/shares
Body:

json
CopyEdit
{ "name": "editing101", "path": "Pool-0/StudentShares/editing101", "comment": "Editing 101 class share", "active": true, "smb": { "enabled": true, "visible": true, "inherit_owner": true, "inherit_perms": true, "access_mode": "user" } }

This creates the shared folder with proper visibility and permission inheritance.


2. Add AD Group to the Share

POST https://<nas-ip>:82/api/v4/shares/editing101/groups
Body:

json
CopyEdit
[ { "name": "editing101-smartU", "readonly": false } ]

This grants the group full write access to the share.


3. Create Home Directories for Each Student

If you want to create home directories under the share path:
POST https://<nas-ip>:82/api/v4/smbclient/directory
Body:

json
CopyEdit
{ "path": "Pool-0/StudentShares/editing101", "dirname": "student1", "user": "admin", "password": "admin" }

You would loop this for each student (student1, student2, etc.).


4. Restart SMB (Optional After Config Changes)

POST https://<nas-ip>:82/api/v4/services/smb/restart
No body needed

Useful after bulk changes.