Skip to content

Latest commit

 

History

History
147 lines (106 loc) · 6.43 KB

collaboration_allowlists.md

File metadata and controls

147 lines (106 loc) · 6.43 KB

Collaboration Allowlists

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

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);

Get a Collaboration Allowlist's Information for a Domain

A specific collaboration allowlist for a domain can be retrieved with getInfo()

BoxCollaborationAllowlist domainAllowlist = new BoxCollaborationAllowlist(api, "id");
domainAllowlist.getInfo();

Get all Collaboration Allowlist's Information for Domain

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);

Remove a Collaboration Allowlist for a Domain

To remove a collaboration allowlist you can call delete()

BoxCollaborationAllowlist domainToBeDeleted = new BoxCollaborationAllowlist(api, "allowlist-id");
domainToBeDeleted.delete();

Add a Collaboration Allowlist for a User

A collaboration allowlist can be created for a user with create(BoxAPIConnection api, String userID)

String userID = "12345";
BoxCollaborationAllowlistExemptTarget.create(api, userID);

Get a Collaboration Allowlist's Information for a User

To retrieve information regarding a specific user collaboration allowlist use getInfo()

BoxCollaborationAllowlistExemptTarget userAllowlist = new BoxCollaborationAllowlistExemptTarget(api, "allowlistID");
userAllowlist.getInfo();

Get all Collaboration Allowlist's Information for a User

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);

Remove a Collaboration Allowlist for a User

To remove a user collaboration allowlist entry from an enterprise use delete()

BoxCollaborationAllowlistExemptTarget userAllowlist = new BoxCollaborationAllowlistExemptTarget(api, "allowlist_id");
userAllowlist.delete();