Collaboration Allowlists are used to manage a set of approved domains or Box users that an enterprise can collaborate with.
- Add a Collaboration Allowlist For a Domain
- Get a Collaboration Allowlist's Information for a Domain
- Get all Collaboration Allowlist's Information for Domain
- Remove a Collaboration Allowlist for a Domain
- Add a Collaboration Allowlist for a User
- Get a Collaboration Allowlist's Information for a User
- Get all Collaboration Allowlist's Information for a User
- Remove a Collaboration Allowlist for a User
A collaboration allowlist can be created for a domain with
create(BoxAPIConnection api, String domain, AllowlistDirection direction)
.
The AllowlistDirection
parameter determines which way the allowlisting
applies. You can set the value to inbound, outbound, or both.
BoxCollaborationAllowlist.create(api, "test.com", BoxCollaborationAllowlist.AllowlistDirection.BOTH);
A specific collaboration allowlist for a domain can be retrieved with
getInfo()
BoxCollaborationAllowlist domainAllowlist = new BoxCollaborationAllowlist(api, "id");
domainAllowlist.getInfo();
All domain collaboration allowlists associated with an enterprise can be
retrieved with getAll(BoxAPIConnection api)
BoxCollaborationAllowlist.getAll(api);
To specify the number of allowlists to retrieve you can pass a limit on how
many allowlists to return to getAll(BoxAPIConnection api, int limit)
.
BoxCollaborationAllowlist.getAll(api, 10);
To remove a collaboration allowlist you can call delete()
BoxCollaborationAllowlist domainToBeDeleted = new BoxCollaborationAllowlist(api, "allowlist-id");
domainToBeDeleted.delete();
A collaboration allowlist can be created for a user with
create(BoxAPIConnection api, String userID)
String userID = "12345";
BoxCollaborationAllowlistExemptTarget.create(api, userID);
To retrieve information regarding a specific user collaboration allowlist use
getInfo()
BoxCollaborationAllowlistExemptTarget userAllowlist = new BoxCollaborationAllowlistExemptTarget(api, "allowlistID");
userAllowlist.getInfo();
To retrieve information regarding all user allowlists associated with an enterprise use
getAll(BoxAPIConnection api)
BoxCollaborationAllowlistExemptTarget.getAll(api);
Alternatively you can specify the number of user allowlists to return with one
request by passing a the maximum number of records to return to
getAll(BoxApiConnection api, int limit)
BoxCollaborationAllowlistExemptTarget.getAll(api, 5);
To remove a user collaboration allowlist entry from an enterprise use
delete()
BoxCollaborationAllowlistExemptTarget userAllowlist = new BoxCollaborationAllowlistExemptTarget(api, "allowlist_id");
userAllowlist.delete();