Open Klant configuration (admin)
Before you can work with Open Klant after installation, a few settings need to be configured first.
Note
This document describes the manual configuration via the admin. You can perform most of this configuration via the command line. which is both faster and less error prone.
Create an API Token
Open Klant
By creating an API token, we can perform an API test call to verify the successful installation.
Configure the Token authorizations for the Open Klant:
Api Auth > Token authorizations
Select Click Token authorization toevoegen (or select the token if it already exists).
Fill out the form:
Identifier: For example:
token-1Contact person: For example:
Person 1Email: For example:
test@example.comOrganization: For example:
Organization XYZApplication: For example:
Application XYZAdministration: For example:
Administration XYZ
Click Opslaan.
After creating the Token, the key can be used in the Authorization header for make the requests.
Example of an API call here command line,
Configure Notificaties API
Next, if notifications are enabled using the NOTIFICATIONS_DISABLED environment variable set to false
(see Environment configuration reference for more information), the notifications for Open Klant must be configured.
We assume you’re also using Open Notificaties to make a complete setup.
Open Klant
The configuration steps below need to be performed in Open Klant itself.
Open Klant consuming the Notificaties API
Configure the credentials for the Notificaties API (so Open Klant can access the Notificaties API):
Navigate to Overige > Services
Select Click Service toevoegen (or select the notifications service if it already exists).
Fill out the form:
Label: For example:
Open NotificatiesService slug: For example:
open-notificatiesType: Select the option:
NRC (Notifications)API root url: the full URL to the Notificaties API root, e.g.
https://notificaties.gemeente.local/api/v1/Client ID: An existing Client ID for the notifications service, or create one and configure the same value in Open Notificaties - For example:
open-klantSecret: Some random string. You will need this later on!
Authorization type: Select the option:
ZGW client_id + secretOAS url: URL that points to the OpenAPI specification. This is typically
<API-ROOT>/schema/openapi.yaml, for example:https://notificaties.gemeente.local/api/v1/schema/openapi.yamlUser ID: Same as the Client ID
User representation: For example:
Open Klant
Click Opslaan.
Next, configure Open Klant to use this service for the Notificaties API:
Navigate to Overige > Notificatiescomponentconfiguratie
Select the service from the previous step in the Notifications api service dropdown.
Sending notifications support autoretry mechanism, which can be also configured here. Fill out the following properties:
Notification delivery max retries: the maximum number of retries the task queue will do if sending a notification failed. Default is
5.Notification delivery retry backoff: a boolean or a number. If this option is set to
True, autoretries will be delayed following the rules of exponential backoff. If this option is set to a number, it is used as a delay factor. Default is3.Notification delivery retry backoff max: an integer, specifying number of seconds. If
Notification delivery retry backoffis enabled, this option will set a maximum delay in seconds between task autoretries. Default is48seconds.
Click Opslaan.
Open Notificaties
We need to allow Open Klant to access Open Notificaties (for authentication purposes, so we can then check its authorisations):
Navigate to API Autorisaties > Autorisatiegegeven
Click Autorisatiegegeven toevoegen.
Fill out the form:
Client ID: The same Client ID as given in Open Klant step 1c. For example:
open-klantSecret: The same Secret as given in Open Klant step 1c
Click Opslaan.
We have to check also the Applicatie is setted in Open Notificaties:
Navigate to API Autorisaties > Applicaties
Click Applicatie toevoegen.
Fill out the form:
Client ID: The same Client ID as given in Open Klant step 1c. For example:
open-klantLabel: For example:
Open Klant
Click Opslaan.
All done! Now Open Klant and Open Notificaties can access each other.
Register Notification channels
Before notifications can be sent to kanalen in Open Notificaties, these kanalen
must first be registered via Open Klant.
Warning
Ensure that the SITE_DOMAIN environment variable is correctly set before registering channels,
as it defines the source from which the channels are retrieved.
For more details, see Environment configuration reference for the full list of available variables
and how to configure them.
Register the required channels:
python src/manage.py register_kanalen
Making an API call
Open Klant
We can now make an HTTP request to one of the APIs of Open Klant. For this example, we have used curl to make the request.
curl --request GET \
--header 'Authorization: Token ba9d233e95e04c4a8a661a27daffe7c9bd019067' \
--header 'Content-Type: application/json' \
{{base_url}}/klantinteracties/api/v1/partijen