Skip to main content

BoxFetcher

Box fetcher (box://) for filesystem-like traversal and content download through Box APIs.

Notes​

Fetches documents from Box using stable ID-based references.

Supported scheme:

  • box://{enterpriseId}/folders/{folderId}
  • box://{enterpriseId}/folders/{folderId}/items/{itemId}

Authentication is either an access token (the default) or, for a crawl that runs on its own, a Box application using Client Credentials Grant (authMethod: CLIENT_CREDENTIALS). Box access tokens expire, and a Client Credentials Grant application asks for a new one whenever the last one does.

Incremental source-delta mode:

  • Box SOURCE_DELTA support is not implemented in v1.
  • In incremental crawls, Box currently relies on standard crawler-side scan semantics (changeDiscovery: CRAWLER_SCAN).

Examples​

The following example starts from the Box root folder boundary.

class: BoxFetcher
accessToken: <token>
apiBaseUrl: https://api.box.com/2.0

Use a start reference such as:

box://my-enterprise/folders/0

The following example keeps the secret out of the configuration with encrypted credentials.

class: BoxFetcher
credentials:
password: ${accessToken}
passwordKey:
source: ENVIRONMENT
value: MY_KEY_VAR

The following example signs in as a Box application, so the access token is asked for again when it expires.

class: BoxFetcher
authMethod: CLIENT_CREDENTIALS
enterpriseId: my-enterprise
credentials:
username: <client ID>
password: ${clientSecret}
passwordKey:
source: ENVIRONMENT
value: MY_KEY_VAR

Usage​

Full configuration skeleton, with every option and its default
class: BoxFetcher
accessToken: string
apiBaseUrl: string
authMethod: ACCESS_TOKEN
credentials:
password: string
passwordKey:
size: 0
source: KEY
value: string
username: string
enterpriseId: string
notFoundStatusCodes:
- 0
referenceFilters: []
tokenUrl: string
validStatusCodes:
- 0

Properties​

PropertyTypeRequiredDefault
accessTokenstringNo-
apiBaseUrlstringNohttps://api.box.com/2.0
authMethodenumNoACCESS_TOKEN
credentialsCredentialsNoCredentials
enterpriseIdstringNo-
notFoundStatusCodesinteger[]No[404]
referenceFiltersReferenceFilter[]No-
tokenUrlstringNohttps://api.box.com/oauth2/token
validStatusCodesinteger[]No[200, 201, 202, 204]

Property Details​

accessToken​

OAuth access token used for Box API requests, kept as is in the configuration. To keep it secret, leave it empty and give it as the password of credentials.

apiBaseUrl​

Box API base URL.

Default: https://api.box.com/2.0

authMethod​

How the fetcher signs in to Box.

Supported values:

  • ACCESS_TOKEN: use accessToken (or the password of credentials) as is. Box expires such a token after an hour unless it was issued to last.
  • CLIENT_CREDENTIALS: use Client Credentials Grant. The user name of credentials is the application's client ID and its password the client secret, and a new access token is asked for when one expires.

Default: ACCESS_TOKEN

Allowed Values​

  • ACCESS_TOKEN
  • CLIENT_CREDENTIALS

credentials​

Credentials holding the OAuth access token as their password (the username is not used), used when accessToken is empty. The password can be encrypted.

enterpriseId​

The Box enterprise the application belongs to. Used with CLIENT_CREDENTIALS.

notFoundStatusCodes​

HTTP status codes treated as "not found" outcomes. Defaults to 404.

referenceFilters​

Filters applied to document references (URLs or file paths) to control which ones are fetched. Documents whose references do not pass the filters are skipped.

tokenUrl​

Box OAuth token address, used with CLIENT_CREDENTIALS.

Default: https://api.box.com/oauth2/token

validStatusCodes​

HTTP status codes treated as successful API responses. Defaults to 200, 201, 202, and 204.