Package: box-sdk-gen
Box Python SDK GENERATEDWe are excited to introduce the latest generation (currently in Beta) of Box Python SDK, designed to elevate the developer experience and streamline your integration with the Box Content Cloud.With this SDK, you’ll have access to:Full API Support: The new generation of Box SDKs empowers developers with complete coverage of the Box API ecosystem. You can now access all the latest features and functionalities offered by Box, allowing you to build even more sophisticated and feature-rich applications.Rapid API Updates: Say goodbye to waiting for new Box APIs to be incorporated into the SDK. With our new auto-generation development approach, we can now add new Box APIs to the SDK at a much faster pace (in a matter of days). This means you can leverage the most up-to-date features in your applications without delay.Embedded Documentation: We understand that easy access to information is crucial for developers. With our new approach, we have included comprehensive documentation for all objects and parameters directly in the source code of the SDK. This means you no longer need to look up this information on the developer portal, saving you time and streamlining your development process.Enhanced Convenience Methods: Our commitment to enhancing your development experience continues with the introduction of convenience methods. These methods cover various aspects such as chunk uploads, classification, and much more.Seamless Start: The new SDKs integrate essential functionalities like authentication, automatic retries with exponential backoff, exception handling, request cancellation, and type checking, enabling you to focus solely on your application's business logic.Embrace the new generation of Box SDKs and unlock the full potential of the Box Content Cloud.Table of contentsInstallingGetting StartedIntegration TestsRunning integration tests locallyCreate Custom ApplicationExport configurationRunning testsQuestions, Bugs, and Feature Requests?Copyright and LicenseInstallingpip install box-sdk-genThis is autogenerated Box SDK Beta version.
Supported Python versions are Python 3.8 and above.To install also extra dependencies required for JWT authentication, use command:pip install box-sdk-gen[jwt]Getting StartedTo get started with the SDK, get a Developer Token from the Configuration page of your app in theBox Developer
Console. You can use this token to make test calls for your own Box account.The SDK provides anBoxDeveloperTokenAuthclass, which allows you to authenticate using your Developer Token.
Use instance ofBoxDeveloperTokenAuthto initializeBoxClientobject.
UsingBoxClientobject you can access managers, which allow you to perform some operations on your Box account.The example below demonstrates how to authenticate with Developer Token and print names of all items inside a root folder.frombox_sdk_genimportBoxClient,BoxDeveloperTokenAuthdefmain(token:str):auth:BoxDeveloperTokenAuth=BoxDeveloperTokenAuth(token=token)client:BoxClient=BoxClient(auth=auth)foriteminclient.folders.get_folder_items('0').entries:print(item.name)if__name__=='__main__':main('INSERT YOUR DEVELOPER TOKEN HERE')Integration TestsRunning integration tests locallyCreate Custom ApplicationTo run integration tests locally you will need aCustom Appcreated in theBox Developer
ConsolewithServer Authentication (with JWT)selected as authentication method.
Once created you can edit properties of the application:In sectionApp Access LevelselectApp + Enterprise Access. You can enable allApplication Scopes.In sectionAdvanced FeaturesenableMake API calls using the as-user headerandGenerate user access tokens.Now selectAuthorizationand submit application to be reviewed by account admin.Export configurationSelectConfigurationtab and in the bottom in the sectionApp Settingsdownload your app configuration settings as JSON.Encode configuration file to Base64, e.g. using command:base64 -i path_to_json_fileSet environment variable:JWT_CONFIG_BASE_64with base64 encoded jwt configuration fileSet environment variable:BOX_FILE_REQUEST_IDwith ID of file request already created in the user account,BOX_EXTERNAL_USER_EMAILwith email of free external user which not belongs to any enterprise.Set environment variable:WORKFLOW_FOLDER_IDwith the ID of the Relay workflow that deletes the file that triggered the workflow. The workflow should have a manual start to be able to start it from the API.Running testsTo run integration tests locally:pip install -r requirements-test.txtpytestQuestions, Bugs, and Feature Requests?Need to contact us directly?Browse the issues
tickets! Or, if that
doesn't work,file a new
oneand we will get
back to you. If you have general questions about the Box API, you can
post to theBox Developer Forum.Copyright and LicenseCopyright 2023 Box, Inc. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.