Connecting Box

edit

Connecting Box

edit

Box is a cloud-based storage service for organizations of all sizes, allowing teams to create, store, share and automatically synchonize documents across desktop, web and mobile.

Workplace Search syncs the following data from Box:

Stored Files and Folders

Including ID, File Metadata, File Content, Updated by, and timestamps

Box cannot be added as a private source

Configure Box

edit

Before connecting Box, you must configure Box. Complete the following steps only once per Workplace Search deployment:


Step 1. Log in to your Box developer console, where you will register your Workplace Search deployment as an OAuth application within the Box ecosystem.

Navigate to the following URL, substituting <BOX_BASE_URL> with the base URL at which your Box service is hosted (scheme + host, no path).

<BOX_BASE_URL>/developers/console

For example:

https://acme.app.box.com/developers/console

Log in to Box with the account that should own the OAuth application. This account must have permission to create an OAuth application through the Box UI. Choose an account to which you won’t lose access, such as a team-owned account.


Step 2. Create a new Box app.

From the developer console, choose Create New App.

box create new app

From the Create New App screen, choose Custom App:

box custom app button

which opens the Custom App form.

box custom app form empty

Step 3. Complete the custom app form.

Within Authentication Method, choose User Authentication (OAuth 2.0).

Within App Name, enter a name, such as "Elastic Workplace Search" or "Workplace Search Your Org Name". Box will display this name later, when asking permission to connect to Workplace Search.

box custom app form complete

Choose Create App to save the app, after which you arrive at the app’s configuration screen.

box configuration

Step 4. Configure the app.

Within OAuth 2.0 Redirect URI, enter the redirect URL for your Workplace Search installation.

Your redirect URL is affected by which user interface you are using to manage Enterprise Search. Enterprise Search in Kibana and standalone Enterprise Search use different redirect URLs. See user interfaces for details on each UI.

For standalone Enterprise Search, enter the following, substituting <WS_BASE_URL> with the base URL at which Workplace Search is hosted (scheme + host, no path).

<WS_BASE_URL>/ws/org/sources/box/create

Examples:

# Deployment using a custom domain name
https://www.example.com/ws/org/sources/box/create

# Deployment using a default Elastic Cloud domain name
https://c3397e558e404195a982cb68e84fbb42.ent-search.us-east-1.aws.found.io:443/ws/org/sources/box/create

# Unsecured local development environment
http://localhost:3002/ws/org/sources/box/create

For Enterprise Search in Kibana, enter the following, substituting <KIBANA_BASE_URL> with the base URL of your Kibana instance. This should correspond with the value of kibana.external_url in your enterprise-search.yml:

<KIBANA_BASE_URL>/app/enterprise_search/workplace_search/sources/added

Examples:

# Deployment using a custom domain name for Kibana
https://www.example.com/app/enterprise_search/workplace_search/sources/added

# Deployment using a default Elastic Cloud domain name for Kibana
https://c3397e558e404195a982cb68e84fbb42.kb.us-east-1.aws.found.io:443/app/enterprise_search/workplace_search/sources/added

# Unsecured local Kibana environment
http://localhost:5601/app/enterprise_search/workplace_search/sources/added
box redirect uri

Within Application Scopes, ensure the following scopes are selected:

  • Read all files and folders stored in Box
  • Read and write all files and folders stored in Box
  • Manage enterprise properties
box scopes

Choose Save Changes to save the configuration.

box save configuration

Step 5. Copy the client ID and client secret to Workplace Search.

Within the Box application configuration screen, locate the section OAuth 2.0 Credentials.

box credentials

You need to copy the Client ID and Client Secret to Workplace Search. Either record those values, or keep this page open while you continue.

Navigate to Workplace Search and log in to the administrative dashboard.

Choose Sources, locate Box, and select Configure.

Within Client id and Client secret, enter the corresponding values from the Box developer console.

Choose Save configuration to complete the process.


With Box configured, you’re ready to connect Box accounts to Workplace Search.

Connect Box

edit

After configuring Box, you can connect Box to Workplace Search. Complete the following steps for each Box account you’d like to connect to your Workplace Search deployment:


Step 1. Navigate to Workplace Search and log in to the administrative dashboard.

Choose Sources.

Within Configured content sources, locate Box.

Choose Connect.


Step 2. Complete the authentication flow with Box.

box connect account

Use the Box account whose data you want to sync to Workplace Search. To support incremental syncs, this account must be a Box admin.

Upon completion, you are redirected back to Workplace Search.


After connecting, Box data begins syncing to Workplace Search. As it syncs, the content is searchable.

After an initial full sync, incremental syncs will run every 2 hours.

Document-level permissions

edit

You can synchronize document access permissions from Box to Workplace Search. This will ensure the right people see the right documents.

See Document-level permissions for Box.

Limiting the content to be indexed

edit

If you don’t need to index all the available content, you can specify the indexing rules via the API. This will help shorten indexing times and limit the size of the index. See Customizing indexing. For Box, applicable rule types would be path_template and file_extension.

Synchronized fields

edit

The following table lists the fields synchronized from the connected source to Workplace Search. The attributes in the table apply to the default search application, as follows:

  • Display name - The label used when displayed in the UI
  • Field name - The name of the underlying field attribute
  • Faceted filter - whether the field is a faceted filter by default, or can be enabled (see also: Customizing filters)
  • Automatic query refinement preceding phrases - The default list of phrases that must precede a value of this field in a search query in order to automatically trigger query refinement. If "None," a value from this field may trigger refinement regardless of where it is found in the query string. If '', a value from this field must be the first token(s) in the query string. If N.A., automatic query refinement is not available for this field by default. All fields that have a faceted filter (default or configurable) can also be configured for automatic query refinement; see also Update a content source, Get a content source’s automatic query refinement details and Customizing filters.
Display name Field name Faceted filter Automatic query refinement preceding phrases

Id

id

No

N.A.

URL

url

No

N.A.

Title

title

No

N.A.

Type

type

Default

None

Path

path

No

N.A

Created at

created_at

No

N.A.

Created by

created_by

Default

[creator is, created by, edited by, modified by]

Updated at

updated_at

No

N.A.

Updated by

updated_by

Configurable

[edited by, updated by, modified by]

Last updated

last_updated

No

N.A.

Status

status

Default

[with status, status is, in state, '']

Size

size

No

N.A

Extension

extension

Default

None

Media type

mime_type

Default

None