All things API and SDK related
Recently active
I am using trial version of Enterprise Box and I have created Box Custom application (authorized by Box admin). Then I generated a private key PK for that Box application and I use this PK to connect to Box App from AWS Kendra. I use Kendra Developer Edition in this test. This method used to work, however today I received the below connection error after providing new PK to Kendra. PK is passed to Kendra using Secrets Manager. Error connecting to customer repository: Error parsing PKCS private key for Box Developer Edition. I made sure the PK is copied properly to Kendra. I also tested connectivity using the same PK and Box SDK and I can connect successfully to Box App programmatically using Python, however the connection from AWS Console fails. What can cause this error? This is private key format generated from BOX Application. It contains “\n” character as text. I normally copy “privateKey” into secret in Secrets Manager Kendra uses and this used to work. { "boxAppSettings": {
var sdkConfig = require(‘…/…/config/0_l3tozglf_config.json’); var sdk = BoxSDK.getPreconfiguredInstance(sdkConfig); // var client = sdk.getAppAuthClient('enterprise'); var client = sdk.getAppAuthClient('user', '32656874023'); const parentFolderID = '0'; const folderName = 'New Folder'; let create_folder = await client.folders.create(parentFolderID, folderName)
We are planning shared folders (app folders) for about 50 applications. The folder structure could be as simple as AppA/FolderX and AppB/FolderX. Users can be authorized for several apps. Let’s say we want to authorize a user to edit files in each FolderX. We can share both folders and users see “FolderX” twice in their box. I guess via API it would be possible, to address both folders individually, but we want to make the apps available via box web interface, too. What we really want is to show users the full AppA and AppB folder structure in the web interface without any files that are stored in other folders than FolderX. What we can do is to additionally authorize users to view AppA and AppB. The full directory structure is then visible in the user interface so he users can see if the displayed FolderX belong to AppA and AppB. But users will also be allowed to view files outside FolderX. If we could share AppA with the privilege to “only view folders”, then that would help. I am pr
Hello, I am currently building an integration that downloads & uploads files from Box using the Box Python SDK. I am having issues using the upload_stream function (https://github.com/box/box-python-sdk/blob/main/docs/usage/files.md#upload-a-file) with an IOBase stream. I am doing the below (taken from the docs): new_file = parent_folder.upload_stream(object_bytes, file_name) The error I get it is: TypeError: unsupported operand type(s) for -: 'NoneType' and 'int' File "upload_to_box", line 174, in upload_small_file new_file = parent_folder.upload_stream(object_bytes, file_name) File "/usr/local/lib/python3.10/site-packages/boxsdk/util/api_call_decorator.py", line 63, in call return method(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/boxsdk/object/folder.py", line 322, in upload_stream file_response = self._session.post( File "/usr/local/lib/python3.10/site-packages/boxsdk/session/session.py", line 100, in post return self.request('POST', ur
Are there any Drupal (10.x+) modules for uploading files from Drupal forms to BoxAPI? I see a few of Drupal 7 modules, but nothing solid and nothing upgrade to the latest Drupal. I am looking for a form (or webform) element. I’ve used the API before to upload and download. But I’d prefer to not have to write this. And I’m very surprised not to see an existing module or suite of modules that integrate well.
I have abandoned using Box with PHP because the support is abysmal. Since this is an internal only application anyways, I’m using JavaScript. I can successfully download a file by searching for it using the /search?query=filename.ext&type=file endpoint. In the response, there are several entries, but I can find the specific file I’m looking for by using JavaScript’s find method checking the entry’s name and parent.id. When I try to upload a file using the /files/content endpoint, I am getting a 404 from the response using this function: async uploadFile(filename, rawFiles) { if (!this.#accessToken) { const errorMessage = 'Access Token is not set. Please authenticate first.' console.error(errorMessage); throw new Error(error); } const uploadUrl = 'https://api.box.com/2.0/files/content'; const parentFolderId = '-redacted-'; if (rawFiles?.length === 0) { const errorMessage = 'Please select a file.' console.error(errorMessage); throw new Error(error); } const file
Goal: Iterate through folder and get list of files. Upload files to box folder, and if successful, remove the file. Service running as a scheduled task in Windows Server 2022 to run Powershell script nightly. I cannot get a response from box files:upload when its successful. Any Suggestions?
Hi, We are using jenkins tool to upload files on box folder but due to the below mentioned error box uploads are failing: Please check the ‘exp’ claim. The ‘exp’ value exceeds the maximum value of 60 seconds beyond the issue time Please suggest. Shailendra Jetpuria
In today’s data-rich landscape, extracting meaningful insights from unstructured documents is crucial. With the Box AI API, you get a powerful toolkit to help your teams to tap into the value of their content, deliver summaries, and engage in conversational AI. This is a companion discussion topic for the original entry at https://medium.com/box-developer-blog/python-workshop-box-ai-api-e405f6912ead?source=rss----a995c24848a3---4
I have the following error when creating the JWT connection: Error: (‘The key data could not be deserialized. The data may be in an incorrect format, may be encrypted with an unsupported algorithm, or may be an unsupported key type (for example, EC curves with explicit parameters).’, [<OpenSSLError (code=503841036, lib=60, reason=524556, text_reason=unsupported)>])
Life moves forward, whether certain features stay behind or vanish into digital oblivion altogether. [Sigh] We’d like to announce that Box will end support the File Picker UI Element. At this time, customers will be able to use their existing applications with the File Picker UI Element with no impact, but will not receive new features, updates, or bug fixes. This is a companion discussion topic for the original entry at https://medium.com/box-developer-blog/end-of-support-for-box-file-picker-ui-element-4557fdf7a78c?source=rss----a995c24848a3---4
I’m excited about box_sdk_gen! I’m trying this , but “ModuleNotFoundError: No module named ‘box_sdk_gen.auth’” occured. of cource I’ve done pip install box_sdk_gen. where’s box_sdk_gen.auth?
I’m following these instructions and I am struggling to decrypt the private key in ColdFusion/Lucee. Here’s how it’s done in PHP: $private_key = $config->boxAppSettings->appAuth->privateKey; $passphrase = $config->boxAppSettings->appAuth->passphrase; $key = openssl_pkey_get_private($private_key, $passphrase); Has anyone managed to get it working?
I generated a script to be able to upload backup files from a database to my BOX account developed with python. When I run the script it works correctly but when I go to the box I don’t see the uploaded files. The script is configured to upload the files to folder id 0. Running the script returns it tells me that the files already exist. Do you have any idea what could be happening?
Hi, I’d like to set up a watch folder on my Box account that will automatically download to a specified location on my local storage whenever a new file appears. I can currently do this manually with the CLI but would like to trigger this with a watch folder. Is that possible? Thanks, Chris
Hello team, I’m currently engaged with the Box Platform and Box Webhook. I have a question regarding the folder creation event – does it trigger when all files within the folder are uploaded, or does it happen immediately upon creating the folder? Furthermore, is it possible for me to promptly make an API call to retrieve the list of files in the folder and download them right after receiving the folder created event? Thanks,
Background: We have a github cicd on a self-runner host from AWS. In this workflow we build our daily software and upload to Box using below command. This has been working for the past 6 month. Issue: Last couple of months, I am getting frequent errors that “item already exists”. (1) The problem is that files get uploaded correctly and when I check the box, I do see all the files. However, not sure why I am getting these errors. (2) It is not possible to have “same name” since each build has a unique github commit ID attached to our release target name. i.e, There are 3 different unique IDs concatenated together. Here is an example “0514.2_A_0.0.48_5b57cb4_0308”. Hence it is impossible to have same name. What is going on here? I need support from Box Team. This is not something we can afford to constantly have errors for no apparent reason. Error Error: Unexpected API Response [409 Conflict | 4t6w1ehnkir5p8jc.0786afe948d834788dc1f0ba396b1cc64] item_name_in_use - Item with the same nam
Box recently released a brand new .NET SDK that has full api coverage, fast and predictable updates thanks to the generated nature of the SDK and is even easier to use than the old .NET SDK. It was also recently published to the Nuget, so now it’s the perfect time to learn how to take full advantage of it’s capabilities. This is a companion discussion topic for the original entry at https://medium.com/box-developer-blog/getting-started-with-the-new-box-net-sdk-c3c39a9d3337?source=rss----a995c24848a3---4
I am using box-python-sdk ver3.7.2. GitHub GitHub - box/box-python-sdk: Box SDK for Python Box SDK for Python. Contribute to box/box-python-sdk development by creating an account on GitHub. I referred to the issue below. Is it the same with version 3.7.2 or later? folder.get_items() limit param seems not working. folder.get_items() limit param seems not working for me · Issue #366 · box/box-python-sdk · GitHub There seems to be an issue with slow response times when there are a too many files in a folder. It seems that there are a large number of files(about 12,000 files) under folders in the Box environment that the customer is using. I think the response would be faster if get_items() could limit the number of records retrieved, but I think it would be difficult because it retrieves all records. Is there a source code workaround for this problem other than reducing the number of files in the folder?
Explicitly requesting the extension attribute from the BoxFile.Info object’s getInfo method provides the expected value. However, if requesting the entire BoxFile.Info object’s getInfo’s set of attributes, not explicitly specifying fields to be returned, the extension attribute value is missing. In addition, the SHA1 attribute, which is another specific BoxFile extension to BoxInfo, exists. I would expect both to be provided, but extension is not. Attempted with Box Java SDK versions 4.7.0 and 4.8.0. For example: BoxFile.Info info = file.getInfo("extension"); System.out.println(info.getExtension()); BoxFile.Info info = file.getInfo("sha1"); System.out.println(info.getSha1()); BoxFile.Info info = file.getInfo(); System.out.println(info.getExtension()); System.out.println(info.getSha1()); Example output: doc bddf8a01e139522c81c59b10df840c4379e24cfb null bddf8a01e139522c81c59b10df840c4379e24cfb The null output is unexpected.
Hello there, I am using your API to upload/download files to Box. I have managed to list all the folders and files but when trying to upload or download files and i’m receiving 403 error insufficient_scope. I have created a OAuth 2.0 app and i have all permissions (having a free account). So any solve for me? Thank you for your time.
can anyone help me by getting an esign request Id using the folder Id? I did try requesting extra fields on listing out the esign requests but no luck. Thank you
I am using an App Token as my authentication and I am attempting to find a file by its name by submitting a cURL request to /search?query={filename}&type=file. While the response is successful in both my PHP code and doing it from the terminal, nothing is ever returned. Is there something I’m missing? For what its worth, here is my PHP function: function findRecordByFilename($accessToken, $filename) { $encodedFileName = urlencode($filename); $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.box.com/2.0/search?query=$encodedFileName&type=file", CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "authorization: Bearer $accessToken" ], ]); $response = curl_exec($curl); $curlError = curl_error($curl); curl_close($curl); // do something meaningful here, this is just an example if ($curlError) { echo '<pre><code>' . jso
Hi all, I created an app using JWT authentication and assigned it all permissions in the dev portal, and subsequently authorized it. When trying to run basic commands like “box users”, I am getting a 403 forbidden error. The app has the manage users checkbox checked, and has been authorized. Any ideas why I’m getting an error here? I appreciate your insights, thanks.
I’m calling the Box API directly from JavaScript to upload a new file. As the docs suggest, I run a preflight check first, and that check succeeds (200). The code for the preflight check looks like this: const preflightResponse = await fetch(url, { method: "OPTIONS", headers: { Authorization: `Bearer ${this.#token}`, "Content-Type": "application/json", }, body: JSON.stringify({ name, parent: { id: parentId, }, }), }); After that step succeeds, I move on to the next step of uploading the actual file. For this text, I’m just sending the text “Hello, world!” to a file named hello.txt. The parentId is the folder to upload to, and it exists (otherwise the preflight check would fail). The code to upload the file looks like this: const form = new FormData(); form.append("attributes", JSON.stringify({ name, parent: { id: parentId, }, })); form.append("file", new Blob(["Hello, world!"])); const response = await fetch(url, { method: "POST", headers: { Authorization:
Already have an account? Login
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.