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_DELTAsupport 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.
- YAML
- JSON
- XML
class: BoxFetcher
accessToken: <token>
apiBaseUrl: https://api.box.com/2.0
{
"class": "BoxFetcher",
"accessToken": "<token>",
"apiBaseUrl": "https://api.box.com/2.0"
}
<class>BoxFetcher</class>
<accessToken><token></accessToken>
<apiBaseUrl>https://api.box.com/2.0</apiBaseUrl>
Use a start reference such as:
box://my-enterprise/folders/0
The following example keeps the secret out of the configuration with encrypted credentials.
- YAML
- JSON
- XML
class: BoxFetcher
credentials:
password: ${accessToken}
passwordKey:
source: ENVIRONMENT
value: MY_KEY_VAR
{
"class": "BoxFetcher",
"credentials": {
"password": "${accessToken}",
"passwordKey": {
"source": "ENVIRONMENT",
"value": "MY_KEY_VAR"
}
}
}
<class>BoxFetcher</class>
<credentials>
<password>${accessToken}</password>
<passwordKey>
<source>ENVIRONMENT</source>
<value>MY_KEY_VAR</value>
</passwordKey>
</credentials>
The following example signs in as a Box application, so the access token is asked for again when it expires.
- YAML
- JSON
- XML
class: BoxFetcher
authMethod: CLIENT_CREDENTIALS
enterpriseId: my-enterprise
credentials:
username: <client ID>
password: ${clientSecret}
passwordKey:
source: ENVIRONMENT
value: MY_KEY_VAR
{
"class": "BoxFetcher",
"authMethod": "CLIENT_CREDENTIALS",
"enterpriseId": "my-enterprise",
"credentials": {
"username": "<client ID>",
"password": "${clientSecret}",
"passwordKey": {
"source": "ENVIRONMENT",
"value": "MY_KEY_VAR"
}
}
}
<class>BoxFetcher</class>
<authMethod>CLIENT_CREDENTIALS</authMethod>
<enterpriseId>my-enterprise</enterpriseId>
<credentials>
<username><client ID></username>
<password>${clientSecret}</password>
<passwordKey>
<source>ENVIRONMENT</source>
<value>MY_KEY_VAR</value>
</passwordKey>
</credentials>
Usage
Full configuration skeleton, with every option and its default
- YAML
- JSON
- XML
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
{
"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
]
}
<boxFetcher>
<class>BoxFetcher</class>
<accessToken>string</accessToken>
<apiBaseUrl>string</apiBaseUrl>
<authMethod>ACCESS_TOKEN</authMethod>
<credentials>
<password>string</password>
<passwordKey>
<size>0</size>
<source>KEY</source>
<value>string</value>
</passwordKey>
<username>string</username>
</credentials>
<enterpriseId>string</enterpriseId>
<notFoundStatusCodes>
<notFoundStatusCode>0</notFoundStatusCode>
</notFoundStatusCodes>
<referenceFilters>
<referenceFilter/>
</referenceFilters>
<tokenUrl>string</tokenUrl>
<validStatusCodes>
<validStatusCode>0</validStatusCode>
</validStatusCodes>
</boxFetcher>
Properties
| Property | Type | Required | Default |
|---|---|---|---|
accessToken | string | No | - |
apiBaseUrl | string | No | https://api.box.com/2.0 |
authMethod | enum | No | ACCESS_TOKEN |
credentials | Credentials | No | Credentials |
enterpriseId | string | No | - |
notFoundStatusCodes | integer[] | No | [404] |
referenceFilters | ReferenceFilter[] | No | - |
tokenUrl | string | No | https://api.box.com/oauth2/token |
validStatusCodes | integer[] | 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: useaccessToken(or the password ofcredentials) 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 ofcredentialsis 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_TOKENCLIENT_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.