Details About the Box API used by Spirion to Search Box Accounts
By Mark Mcclung
How Spirion Searches Box
Spirion searches files in Box accounts via the Box API. Each file that is searched requires two API calls.
Box API Call Limit
All Box Business Plans come with a licensed number of permitted API calls per enterprise per month. The number of API calls per month is listed within the plans here – Box Plans. Additional add-on plans or support requests to Box are possible to increase the monthly call limit.
There are currently a few distinct rate limits in place within the Box API:
- General API calls
- 1000 API requests per minute, per user
Rate Limit Error
When an application hits a rate limit the API will return an API response with an HTTP status code of “429 Too Many Requests.”
What API Calls are Used?
Here is a list of all the API calls used in the methods implemented in the CBoxSyncCloudScan class with links to the official documentation:
DownloadFile:
https://developer.box.com/reference/get-files-id/
SendRequest(response, methods::GET, m_rootUrl, _TS("/files/")+fileId+_TS("/content"), _TS(""), headerData);
RenameCloudFile:
https://developer.box.com/reference/put-files-id/
SendRequest(response, methods::PUT, m_rootUrl, _TS("/files/")+fileId, SET_STRING_WIDTH_FOR_IDF(query.serialize()), headerData, _TS("application/json"));
GetSpecifiedUserAccounts:
https://developer.box.com/reference/get-users/
SendRequest(response, methods::GET, m_rootUrl, _TS("/users?") + SET_STRING_WIDTH_FOR_IDF(uriBldr.query()), _TS(""), headerData);
GetUserAccountsByPage:
https://developer.box.com/reference/get-users/
SendRequest(response, methods::GET, m_rootUrl, _TS("/users?") + SET_STRING_WIDTH_FOR_IDF(uriBldr.query()), _TS(""), headerData);
GetFolderContents:
https://developer.box.com/reference/get-folders-id-items/
SendRequest(response, methods::GET, m_rootUrl, _TS("/folders/")+folderId+_TS("/items?")+SET_STRING_WIDTH_FOR_IDF(uriBldr.query()), _TS(""), headerData);
GetFileInfo:
https://developer.box.com/reference/get-files-id/
SendRequest(response, methods::GET, m_rootUrl, _TS("/files/")+fileId, _TS(""), headerData);
GetFolderInfo:
https://developer.box.com/reference/get-folders-id/
SendRequest(response, methods::GET, m_rootUrl, _TS("/folders/") + folderId+_TS("?") + SET_STRING_WIDTH_FOR_IDF(uriBldr.query()), _TS(""), headerData);
CheckMakeCloudFolder:
https://developer.box.com/reference/post-folders/
SendRequest(response, methods::POST, m_rootUrl, _TS("/folders"), SET_STRING_WIDTH_FOR_IDF(query.serialize()), headerData);
UpdateCloudFile:
https://developer.box.com/reference/post-files-content/
SendUploadRequest(FileUploadConfig(fileName), response, methods::POST, m_contentRootUrl, _TS("/files/") + fileId + _TS("/content"), headerData, bodyStrings);
For Box this is the only cloud service where we use the “doDelOrigVersion” to get rid of the original file:
Get previous versions:
https://developer.box.com/reference/get-files-id-versions/
SendRequest(response, methods::GET, m_rootUrl, _TS("/files/") + fileId + _TS("/versions"), _TS(""), headerData);
Delete previous versions:
https://developer.box.com/reference/delete-files-id-versions-id/
SendRequest(response, methods:😀EL, m_rootUrl, _TS("/files/") + fileId + _TS("/versions/") + versionID, _TS(""), headerData);
Additional Information
For updated information regarding Box’s API limits please refer to the following article -