Skip to main content

Box Storage

Load data from Box Storage.

Configure via UI

We can load data by using two different types of authentication methods:

1. Developer Token Authentication Mechanism

box

2. Client Credential Grant Authentication Mechanism

box

Configure via API / Client

1. Developer Token Authentication Mechanism

from llama_cloud.types import CloudBoxDataSource

ds = {
'name': '<your-name>',
'source_type': 'BOX',
'component': CloudBoxDataSource(
folder_id='<folder_id>', # Optional
developer_token='<token>', # Developer Tokens are short lived
)
}
data_source = client.data_sources.create_data_source(request=ds)

2. Client Credential Grant Authentication Mechanism

from llama_cloud.types import CloudBoxDataSource

ds = {
'name': '<your-name>',
'source_type': 'BOX',
'component': CloudBoxDataSource(
folder_id='<folder_id>', # Optional
client_id='<client_id>',
client_secret='<client_secret>',
user_id='<user_id>', # Optional, if using enterprise_id
enterprise_id='<enterprise_id>' # Optional, if using user_id
)
}
data_source = client.data_sources.create_data_source(request=ds)

Setting up Box CCG Credentials

  1. Log in to your Box account / Create a Box developer account and navigate to the developer console.
  2. Create a new custom app.
  3. Select "Server Authentication (Client Credentials Grant)" as the authentication method.
  4. Under "App Access Level", select App + Enterprise Access.
  5. Set all permissions for your app.
  6. Save your changes and submit the app for authorization.
  7. Open Admin console https://app.box.com/master/custom-apps. As an admin, authorize the app in the Custom Apps Manager.
  8. Once the app is enabled, get your User ID, Enterprise ID, Client ID and Client Secret from app console in developer console.