Modifying Folder Settings via the API
Hello,
I am new to the Box API. After reviewing the Box SDK and API documentation I can not find a means of setting or modifying a Box folders' settings. I would like to know if it is possible using the Python SDK or the API directly to set or modify folder settings via the API. The folder settings I am most interested in setting when creating a folder are:
- Only Owners and Co-owners can send collaborator invites (checked)
- Allow people who can access this folder from a shared link to join as a collaborator (unchecked)
- Only collaborators can access this folder via shared links (checked: For files and Folders)
- Allow uploads to this folder via email (unchecked)
If these settings can be modified via the API or Python SDK please point me to where in the documentation I can find this information.
Thanks,
David Riddle
Software Developer
University of Illinois
-
Upon further reading of the SDK documentation and experimentation I have determined that:
- if can_non_owners_invite is set to false then "Only Owners and Co-owners can send collaborator invites" will be checked in the settings for a folder. This can be accomplished with code like this:
from boxsdk import Client, OAuth2 oauth2 = OAuth2(CLIENT_ID, CLIENT_SECRET, access_token=ACCESS_TOKEN) client = Client(oauth2) folder = client.folder(FOLDER_ID) folder.update_info({'can_non_owners_invite': False})
- if folder_upload_email is set to None then "Allow uploads to this folder via email" is unchecked in the settings for a folder. This can be accomplished with code like this:
from boxsdk import Client, OAuth2 oauth2 = OAuth2(CLIENT_ID, CLIENT_SECRET, access_token=ACCESS_TOKEN) client = Client(oauth2) folder = client.folder(FOLDER_ID) folder.update_info({'folder_upload_email': None})
I have not been able to determine how to set the following configuration for a folder via the SDK:
- Allow people who can access this folder from a shared link to join as a collaborator (unchecked)
- Only collaborators can access this folder via shared links (checked: For files and Folders)
If anyone has any insight it would be much appreciated.
- if can_non_owners_invite is set to false then "Only Owners and Co-owners can send collaborator invites" will be checked in the settings for a folder. This can be accomplished with code like this:
Please sign in to leave a comment.
Comments
3 comments