Open Product configuration (admin)
Before you can work with Open Product after installation, a few settings need to be configured first.
Note
This document describes the manual configuration via the admin.
Setting the domain
In the admin, under Configuratie > Websites, make sure to change the existing
Site to the domain under which Open Product will be deployed (see
the manual for more information).
Note
Due to a cache-bug in the underlying framework, you need to restart all replicas for this change to take effect everywhere.
Configure Notificaties API
Next, the notifications for Open Product must be configured. We assume you’re also using Open Notificaties to make a complete setup.
Open Product
The configuration steps below need to be performed in Open Product itself.
Open Product consuming the Notificaties API
Configure the credentials for the Notificaties API (so Open Product can access the Notificaties API):
Navigate to API Autorisaties > 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-productSecret: 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 Product
Click Opslaan.
Next, configure Open Product to use this service for the Notificaties API:
Navigate to Configuratie > 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.
Register notification channels
Open Product
Before notifications can be sent to kanalen in Open Notificaties, these kanalen
must first be registered via Open Product.
Register the required channels:
python src/manage.py register_kanalen
Create an API token
Open Product
By creating an API token, we can perform an API test call to verify the successful installation.
Navigate to Users > Token and click on Token toevoegen in the top right.
Select the user you want to create a token for
Click Opslaan in the bottom left
After creating the Token the key is shown in the list page. This value
can be used in the Authorization header.
Making an API call
We can now make an HTTP request to one of the APIs of Open Product. For this example, we have used curl to make the request.
curl --request GET \
--header 'Authorization: Token 1d4df96cfe14543558118805c5e9252629e805a0' \
--header 'Content-Type: application/json' \
{{base_url}}/producten/api/v1/producten
The example above uses the same value configured in Setting the domain.
Configure openID connect
Open Product
Navigate to Config > OpenID.
Fill in the fields required for the provider you want to use. See OpenID Connect configureren.
Enable the configuration.
Click Opslaan in the bottom left
After creating the Token the key is shown in the list page. This value
can be used in the Authorization header.
Making an API call
We can now make an HTTP request to one of the APIs of Open Product. For this example, we have used curl to make the request.
curl --request GET \
--header 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cC.....' \
--header 'Content-Type: application/json' \
{{base_url}}/producten/api/v1/producten
The example above uses the same value configured in Setting the domain.