Using the Box API as a Box Admin
Many Box Admins use the Box API to automate, extend, and customize their instance of Box. Box also offers an open development platform for building custom applications. Box Admins use the Box API to:
- Automate routine and repetitive processes with Box, like provisioning new user accounts programmatically.
- Connecting internal tools and workflows to Box, like triggering activity in other systems when a file is uploaded to a folder.
- Customizing Box for their business, like programmatically creating default folder structures and automatically sharing content with new users.
To help you learn how you can use the Box API as a Box Admin, we've created a series of useful recipes that you can use to get even more out of Box. We plan to expand this collection over time. Got your own recipe, an idea for a recipe, or want to create one yourself? Feel free to let us know by reaching out to firstname.lastname@example.org. We'd love to showcase your great work and help however we can.
API Recipes for Box Admins:
The following API Recipes can be used to automate, extend, and customize Box.
Provision New Box User Accounts using the Box API
As a Box Admin when new employees join your company, you will have to manage the creation of new users within your Box Enterprise. Instead of doing this manually for each new employee, you can create a script to do this automatically. In this API Recipe, we show you how to authenticate with the Box API, create a series of Box Managed Users using a simple CSV file, create a default set of folders in those users' accounts, upload default files to those folders, add those users as collaborators to a folder, and add those users to a group.
Deprovision Box User Accounts using the Box API
After an employee leaves your company, you will need to deprovision their Box account. This process has two parts. First, you will need to move that employee's folders and files to an Admin account. Second, you will need to delete the employee's account. The recipe on this page will show how to do this with the Box API.
Get a List of All Box User Accounts in a Box Enterprise using the Box API
To keep track of people in your organization using Box, you might want to generate a daily list of users in your Box enterprise. In this recipe, we show you how to authenticate with the Box API, get a list of all Box users in a Box enterprise, and then save the list of users to a CSV.
Automatically Upload All Files from a Folder using the Box API
A popular Box API use case is having to upload all files from a local folder on a regular basis. For example, maybe you want to backup your server's log files to Box using our API each day. In this recipe, we show you how to authenticate with the Box API, upload all files from a folder using a Service Account, and upload all files from a folder as a specific user.
File Workflow Automation using Webhooks and the Box API
Many business processes involve a file-based workflow. For example, let's say you are an insurance company and you need a way for companies to enroll their employees on an insurance plan. You can ask the company to upload a CSV with the list of employees to a Box folder. The insurance company can automatically process the enrollment of these employees by getting a notification about the CSV through a Box webhook. With the Box API, you can download that CSV with the list of employees and then upload a modified version back showing the employees were enrolled. This API recipe will show you how to accomplish those steps.