Open Organisatie configuration (admin)

Before you can work with Open Organisatie after installation, a few settings need to be configured first.

Note

This document describes the manual configuration via the admin.

Setting the domain

Warning

Ensure that the SITE_DOMAIN environment variable is correctly set. For more details, see Environment configuration reference.

Configure Notificaties API

Next, the notifications for Open Organisatie must be configured. We assume you’re also using Open Notificaties to make a complete setup.

Open Organisatie

The configuration steps below need to be performed in Open Organisatie itself.

Open Organisatie consuming the Notificaties API

  1. Configure the credentials for the Notificaties API (so Open Organisatie can access the Notificaties API):

    1. Navigate to API Autorisaties > Services

    2. Select Click Service toevoegen (or select the notifications service if it already exists).

    3. Fill out the form:

      • Label: For example: Open Notificaties

      • Service slug: For example: open-notificaties

      • Type: 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-organisatie

      • Secret: Some random string. You will need this later on!

      • Authorization type: Select the option: ZGW client_id + secret

      • OAS 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.yaml

      • User ID: Same as the Client ID

      • User representation: For example: Open Organisatie

    4. Click Opslaan.

  2. Next, configure Open Organisatie to use this service for the Notificaties API:

    1. Navigate to Configuratie > Notificatiescomponentconfiguratie

    2. Select the service from the previous step in the Notifications api service dropdown.

    3. 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 is 3.

      • Notification delivery retry backoff max: an integer, specifying number of seconds. If Notification delivery retry backoff is enabled, this option will set a maximum delay in seconds between task autoretries. Default is 48 seconds.

    4. Click Opslaan.

Register notification channels

Open Organisatie

Before notifications can be sent to kanalen in Open Notificaties, these kanalen must first be registered via Open Organisatie.

Register the required channels:

python src/manage.py register_kanalen

Create an API token

Open Organisatie

By creating an API token, we can perform an API test call to verify the successful installation.

Navigate to API Authorisaties > Tokens and click on Token toevoegen in the top right.

  1. Select the user you want to create a token for

  2. 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

Open Organisatie

We can now make an HTTP request to one of the APIs of Open Organisatie. 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}}/organisatie/api/v0/medewerker