Scoped API Key for Drupal Search API Opensolr

One box, exactly the endpoints the module calls

A key that only does what the module does

The Drupal module Search API Opensolr connects Search API to your Opensolr indexes. It works with your master API key, but it does not need everything that key can do. Give it a scoped key made for it instead: one box ticks exactly the endpoints the module calls.

Create the key

  1. Open Account › API Keys.
  2. Name this key, for example Drupal site www.example.com.
  3. Under What may this key do?, tick Drupal: Search API Opensolr.
  4. Under Which indexes may it touch?, keep All of my indexes, or tick only the indexes this site uses. If you create new indexes from Drupal, keep all, or add a name pattern that matches them.
  5. Click Create key and copy it.

You do not use the Search API Opensolr Security submodule? Untick its five endpoints before you create the key.

Put it in Drupal

  1. Open the Opensolr settings of Search API: /admin/config/search/search-api/opensolr on your site.
  2. Under Opensolr API Credentials, the Email stays the email of your Opensolr account.
  3. Paste the scoped key as the Secret key and save.

The key must be sent with the email of the account that created it, also when a colleague sets up the site.

What the box ticks: 19 endpoints

Search API Opensolr

EndpointWhat the module uses it for
get_index_listLists your indexes so you can pick one for a Search API server.
get_envLists the regions you can create a new index in.
create_coreCreates a new index from the module.
get_core_infoReads the address, size and HTTP password of the index when you save the server.
get_core_statusShows the status of the index on the server page.
reload_coreReloads the index after a configuration change.
commitMakes the latest indexed content visible in search.
optimizeOptimizes the index on request.
delete_coreDeletes an index from the module.
replicate_indexCopies an index into another index of yours.
get_all_config_filesLists the configuration files of the index.
upload_zip_config_filesUploads the Search API configuration files as one zip.
upload_config_fileUploads a single configuration file.
delete_config_fileDeletes a configuration file.

Search API Opensolr Security (submodule)

EndpointWhat the module uses it for
update_http_authSets the HTTP username and password of the index.
remove_http_authRemoves the HTTP password of the index.
get_ip_listLists the addresses allowed to reach the index.
add_ipAllows an address to reach the index.
delete_ipRemoves an allowed address.

Good to know

  • The module reads the HTTP password of an index with get_core_info, to connect Search API to it. So this key can read the passwords of the indexes it may touch.
  • A new version of the module may start calling a new endpoint. If it answers 403 ERROR_SCOPED_KEY_ENDPOINT_NOT_ALLOWED, edit the key and tick the box again.
  • You can change, revoke or regenerate the key at any time on Account › API Keys. See Authentication and keys.

More about the module

API Reference pages