Example : Calling an API operation
See below for a detailed example using Postman and here for an example using .NET.
1. Obtain an OAuth token
To call an OBOS API you first need to obtain an OAuth token. To do this you first need to register your application/service. You can do that here.
When the application/service registration has been completed you will receive credentials for obtaining an OAuth token.
Example: using Postman to get a token.
Make a POST to https://login.microsoftonline.com/obos.no/oauth2/token (OBOS Azure AD token endpoint)
Using the following body parameters:
client_id ={GUID}- ClientID you received after registering your application/serviceclient_secret={client secret}- Client secret you received after registering your application/servicegrant_type=client_credentialsresource={resource GUID}- Points to the backend/API you want to reach. You received it after registering your application/service

The result of the operation should be a JSON as shown below. The value of the "access_token" parameter is what is needed when calling the OBOS APIs.
{"token_type": "Bearer","expires_in": "3599","ext_expires_in": "3599","expires_on": "1591033168","not_before": "1591029268","resource": "dc12b111-ab27-111-ac7b-d736959f971e","access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI..."}
2. Obtaining a subscription key
You also need a subscription key to call an API operation. This page describes how to set up a subscription and how to obtain a subscription key.
3. Call an API operation
You now have what you need to call an API operation.
Use the API's documentation to get its URL and parameters.
Specify the following headers:
Ocp-Apim-Subscription-Key={subscription key for the Product containing the API}Authorization=Bearer {OAuth token/access_token value}
