Connecting to the API
Server Endpoint
http:
http:
Security
For requests that require authentication, you will need to have your users authenticate via our OAuth mechanisms handled with Keycloak. See Keycloak for more information.
There are many libraries available for a lot of languages to help you with this.
If you want to manually integrate, here are the OAuth2 relevant URls:
http:/auth/realms/consent-manager/protocol/openid-connect/auth
http:/auth/realms/consent-manager/protocol/openid-connect/token
http:/auth/realms/consent-manager/protocol/openid-connect/token
Headers
For requests that require authentication, you need to provide a Bearer token, obtained from Keycloak (see above).
Authorization: Bearer TOKEN
Javascript library
We provide a Javascript library to help you use the API. Sources are available on Github.
To install the library, you can use npm:
npm install @fairandsmart/consents-ce
Or you can include the library in your HTML page:
<script src="https://assets.fairandsmart.tech/consent.js"></script>
When the consent.js file is imported via a script tag, the SDK features are available in the window.FairAndSmart
global variable of your web page.
The full documentation for the library is available here.