Howto - Setup Insomnium
We are using Insomnium in the Howto's to simulate the client connecting.
Content
Requirements:
- Insomnium installed
- Your client id - provided by 1WorldSync
- Your client secret - provided by 1WorldSync
- In addition you might need settings specific to the endpoint you use - for example webhook target for subscriptions
- Download the Insomnium collection: see download section. The collection already has all the needed environment settings.
Please ensure that you use the client-id and client_secret fitting the environment you are using, and you have selected the correct environment!
Setup Insomnium
When starting Insomnium the first time you will see an empty collection. We will open the collection overview by clicking on Insomnium.

We will then open the import dialogue by clicking on the +-icon and then on Import.

Inside the upload dialogue, we will select the downloaded insomnium collection and click on Scan.

After that we can open the imported dialogue by clicking on 1WorldSync-api-collection.

You can switch between the imported environments by clicking on Base environment and selecting the environment to use.

In order to correctly use the environments, you have to enter the client_id and client_secret you received from 1WorldSync. You can do this by opening the environment settings.

Here you can select the environment you want to adjust and enter the provided credentials.

Authorization
To use the API you have to be authorized. We use a jwt token in the request header. You can create a token via the Insomnium authorization helper. But be aware that the token has a ttl of 5 minutes after which you have to request a new token.
Set the authentication of a request to OAuth 2.0.

After that you have to change the Grant Type to client credentials.

Fill in the next fields with following variables:
| Field | Value |
|---|---|
| Access Token URL | _.keycloak_token_url |
| Client ID | _.client_id |
| Client Secret | _.client_secret |
Then press Fetch tokens to retrieve a token. If successful Insomnium states Authentication complete. If this is not working check your credentials and the environment you are trying to authorize yourself against. If all your data are correct and several attempts fail please contact 1WorldSync for support.

You are ready to authenticate. You can now send your request by clicking on Send. If your token is expired, you can refresh the token by clicking two times on Refresh token.
