Skip to content

Latest commit

 

History

History
51 lines (38 loc) · 1.54 KB

README.adoc

File metadata and controls

51 lines (38 loc) · 1.54 KB

thesaurus

snapshots Maven Central

Thesaurus popup

Example

source code of the thesaurus frontend deployed in the NPO API.

This is deployed here

NPO API authentication

This is used as follows

In your <head>

  <script src="//cdnjs.cloudflare.com/ajax/libs/crypto-js/4.2.0/crypto-js.min.js" integrity="sha512-a+SUDuwNzXDvz4XrIcXHuCf089/iJAoN4lmrXJg18XnduKK6YlDHNRalv4yd1N40OKI80tFidF+rqTFKGPoWFQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  <script src="https://rs.poms.omroep.nl/v1/npo-api/authentication.js"></script>
  <script>
      var npoAuthentication = new NpoApiAuthentication('${param.apiKey}', '${param.apiSecret}');
  </script>

And then in javascript:

  var params =  {
     max: maxResults,
     schemes: 'names',
     text: text
   };
   var suggestionHeaders = {
      "x-origin": document.location.origin
   };
   var path = "thesaurus/concepts/"
   npoAuthentication.addAuthorizationHeader(suggestionHeaders, path, params);
   $http.get('/v1/api/' + path, {
     params: params,
     headers: suggestionHeaders
    }).then(function (response) {
 ...