EditionGuard API
What is EditionGuard API?
This module helps you to connect with
EditionGuard API. Integrate with EditionGuard API v2 Synopsis
https://api.editionguard.com/v2/welcome/synopsis .
Important Note
The intended audience is module developers or web site programmers.
Usage
The base module does not have a UI and does nothing by itself. The intended audience is module developers or web site programmers. Only the configuration may be relevant for webmasters and website builders.
For module developers
Check src/Form/TestForm.php for examples.
// Edition Guard Client API.
$client = \Drupal::service('editionguard_api.client');
// Create ebook - https://editionguard.api-docs.io/v2/book .
$form_params['title'] = 'MY_BOOK_TITLE_NAME';
$fid = $entity->get("MY_FIELD_FILE_NAME")->entity->getFileUri();
$stream_wrapper_manager = \Drupal::service('stream_wrapper_manager')
->getViaUri($fid);
$file_path = $stream_wrapper_manager->realpath();
$form_params['resource'] = $file_path;
$endpoint = $client->getEndpointPluginManager()->createInstance('book_create');
$result = $client->request($endpoint, $endpoint_query_params = [], $endpoint_form_params);
// Get ebooks list - https://editionguard.api-docs.io/v2/book .
$endpoint = $client->getEndpointPluginManager()->createInstance('book_list');
$result = $client->request($endpoint, $endpoint_query_params = [], $endpoint_form_params = []);
Related Modules
Credits
This module is a adapted fork of trustpilot_api.
Big thank you to Daggerhart who developed the trustpilot_api well written module.
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.