Skip to content

source code of the thesaurus frontend deployed in the NPO API

Notifications You must be signed in to change notification settings

npo-poms/thesaurus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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) {
 ...