Smithsonian Open Access API
Smithsonian Open Access API Integration
The Smithsonian Open Access module provides a simple and convenient way to interact with the Smithsonian Open Access API in your Drupal site. It allows you to search the API, customize the search results using various parameters, and display the JSON data on the screen.
Features
- Easy configuration of API settings through the Drupal admin interface
- Test API key functionality to verify the validity of the API key
- A search form to test search queries using the Smithsonian Open Access API
- An API wrapper class (
Api.php) that can be used by other developers to interact with the API
Installation
- Download the
smithsonian_open_accessmodule and place it in the/modules/customdirectory of your Drupal site. If you cloned the repository, make sure the name of the module directory issmithsonian_open_access. - Enable the module using the Drupal admin interface or by running
drush en smithsonian_open_accessin the command line.
Configuration
- Navigate to the module configuration page at
/admin/config/smithsonian-open-access. - Enter your Smithsonian Open Access API key and customize other settings if necessary. To obtain an API key for the Smithsonian Open Access API, visit data.gov.
- Click the "Test API Key" button to verify the validity of your API key.
- Save the configuration.
Usage
To use the search form provided by the module, navigate to /admin/config/content/smithsonian-open-access/search-test. Enter a search phrase and click the "Search" button to display the JSON data returned by the API.
To use the API wrapper class in your custom code, you can follow these steps:
- Import the
Apiclass:use Drupal\smithsonian_open_access\Api; - Inject the
Apiclass as a dependency in your custom class or service. - Call the
search()method of theApiclass to perform a search query.
Refer to the module's source code for more examples and details on using the API wrapper class.
API Documentation
The smithsonian_open_access.api.yml file in the module's root directory provides an OpenAPI specification for the module's API. You can use this file to generate API documentation or provide it to other developers for easier integration.
License and Content
This module is licensed under the GNU General Public License v2.0 or later.
The content provided by the Smithsonian Open Access API is available under the CC0 1.0 Universal (CC0 1.0) Public Domain Dedication. You are free to use, modify, and distribute the content for any purpose, including commercial use, without requiring attribution to the Smithsonian Institution.
Please note that while the API provides CC0 content, other aspects of the module, such as code and documentation, may be subject to different licensing terms.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | Release date | |
|---|---|---|---|---|
| 1.0.x-dev | Dev | May 4, 2023 |