Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-142: Fixes Europeana API to version 0.10.3 #143

Merged
merged 2 commits into from
Aug 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ $settings['webform_strawberryfield.europeana_entity_apikey'] = 'thekey';

Save and clear caches.

In its current state the Europeana Entity API (Alpha 0.5) uses a static APIKEY (not the same as other APIs) and can be found at https://pro.europeana.eu/page/entity#suggest
In its current state the Europeana Entity API (Alpha 0.10.3) as of December 2021 uses a static APIKEY (not the same as other APIs) and can be requested at https://pro.europeana.eu/page/get-api

If using https://github.com/esmero/archipelago-deployment this is not needed and will be provided by the deployment.
If using https://github.com/esmero/archipelago-deployment this is not needed and a stub one be provided by the deployment.
Please read the Terms of Use: https://www.europeana.eu/en/rights/api-terms-of-use

## Help

Expand Down
9 changes: 5 additions & 4 deletions src/Controller/AuthAutocompleteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ protected function europeana($input, $vocab, string $apikey) {
'agent',
'concept',
'place',
'timespan',
])) {
// Drop before trying to hit non existing vocab
$this->messenger()->addError(
Expand All @@ -702,7 +703,7 @@ protected function europeana($input, $vocab, string $apikey) {

$urlindex = "/suggest?text=" . $input . "&type=" . $vocab ."&wskey=". $apikey ;

$baseurl = 'https://www.europeana.eu/api/entities';
$baseurl = 'https://api.europeana.eu/entity';
$remoteUrl = $baseurl . $urlindex;
$options['headers'] = ['Accept' => 'application/ld+json'];
$body = $this->getRemoteJsonData($remoteUrl, $options);
Expand All @@ -720,8 +721,8 @@ protected function europeana($input, $vocab, string $apikey) {
}
],
"total": 10,
"type": "BasicContainer",
"contains": [
"type": "ResultPage",
"items": [
{
"type": "Agent"
"id": "http://data.europeana.eu/agent/base/147466",
Expand All @@ -735,7 +736,7 @@ protected function europeana($input, $vocab, string $apikey) {
]
}
*/
// @NOTE!: This is API V 0.5 Already ill documented and its changing. So review the API every 2-3 months
// @NOTE: This is Entities API is 0.10.3 (December 2021)and it might chang. So review the API every 6 months
if (isset($jsondata['total']) && $jsondata['total'] >= 1 && isset($jsondata['items']) && is_array($jsondata['items'])) {
foreach ($jsondata['items'] as $key => $result) {
$desc = NULL;
Expand Down