This service delivers the up-to-date imprint content for the ACDH applications, which can be modified by some project-specific parameters.
In order to define your project’s imprint parameters, please go to the Redmine service ticket of your project and fill out the “ImprintParams” field in YAML format as following:
language: [en, de] responsiblePersons: en: de: projectNature: en: de: websiteAim: en: Fundament is dedicated to offering a frontend framework for ACDH web applications. de: Fundament widmet sich der Bereitstellung eines Frontend-Frameworks für ACDH Web-Applikationen. copyrightNotice: en: de: hasMatomo: yes
Please note that language defaults to both, hasMatomo defaults to true and copyrightNotice defaults to a description of CC-BY-SA 4.0 International license.
Making a Request
The API call to this service must be made to the following URI with a serviceID:
https://shared.acdh.oeaw.ac.at/acdh-common-assets/api/imprint.php?serviceID=9945&outputLang=de
This service expects the following parameters appended to the end of the request URI:
* @param {int} serviceID - Redmine issue ID of your service. * @param {string} outputLang - Preferred imprint content language, currently accepted are: en and de. (optional) * @param {bool} raw - In case a raw JSON output is preferred. (optional)
The serviceID parameter is required for the service to function.
Examples
Here are some examples on how to make a request to use the imprint service:
PHP
The following can be used in a web application written in PHP5+:
<div id="imprint-content"> <?php $params = http_build_query(array( 'serviceID' => '9945', 'outputLang' => 'en' )); $response = file_get_contents('https://shared.acdh.oeaw.ac.at/acdh-common-assets/api/imprint.php?'.$params); echo $response; ?> </div><!-- #imprint-content -->
Python
The following code example would work with Python3:
import urllib.request language = 'de' # Output language service_id = 1234 # Redmine service issue number url = """https://shared.acdh.oeaw.ac.at/acdh-common-assets/api/imprint.php?serviceID={service_id}&outputLang={language}""".format( service_id=service_id, language=language) # It is important to call 'urlib.request' and not just 'request' otherwise there could be confusion with libraries imprint = urllib.request.urlopen(url).read().decode('utf-8')
With JQuery (AJAX)
Please keep in mind that the following inline JavaScript code would only work if it’s included after the jquery.js in the HTML document. Alternatively you can move this script to your separate .js file, which is included after the JQuery is loaded.
<div id="imprint-content"></div><!-- #imprint-content --> <script> const params = { 'serviceID': '9945', 'outputLang': 'en' }; const imprintService = 'https://shared.acdh.oeaw.ac.at/acdh-common-assets/api/imprint.php'; $.get(imprintService, params, function(response){ document.getElementById('imprint-content').innerHTML = response; }); </script>