Hello All,
We have a requirement to search for documents in BOX and create metadata on them. We are able to do this.
Question is with number of API calls. We are limited by certain number of API calls per month. So we need to know the count before executing.
Below is the code snippet removed all non box statements,
1. Initial config, how many API calls
//Initial config, 1 or 2 api calls?
BoxConfig boxConfig = BoxConfig.readFrom(reader);
BoxUser.Info userInfo = BoxUser.getCurrentUser(boxConn).getInfo();
//Initial config, 1 or 2 api calls?
2. Search
//search, most likely one api call for searchRange. how about iterating over the results?
BoxSearchParameters boxSearchParameters = new BoxSearchParameters();
boxSearchParameters.setScope(scope);
boxSearchParameters.setType("file");
boxSearchParameters.setContentTypes(contentTypes);
boxSearchParameters.setAncestorFolderIds(ancestorFolderIds);
boxSearchParameters.setQuery(boxQuery);
PartialCollection partialCollection = boxSearch.searchRange(x, y, boxSearchParameters);
Iterator pcIterator = partialCollection.iterator();
while(pcIterator.hasNext()){
returnString = pcIterator.next().getID();
}
//search, most likely one api call for searchRange. how about iterating over the results?
3. Update metadata
//Update metadata, most likely one api call on createMetadata?
mdtBox = new Metadata(jsonObject);
boxFile.createMetadata(mdTemplate, mdtBox);
//Update metadata, most likely one api call on createMetadata?
Thanks,
Sundar.