Getting started
Welcome to the developer documentation for the PTS-service. This getting started guide will help you get up and running consuming our API. For a more in depth description and information about the service it self, please go take a look at the general documentation first.
Testing the API
Our API is available in two environments; test and production. The test instance will not contain any sensitive data and you or your system should never send sensitive data to it.
Test environment
The test environment is available on Helsenettet at https://api.test.pts.nhn.no.
And the regular Internet at https://api-internett.test.pts.nhn.no
Production environment
The production environment is available at https://api.pts.nhn.no.
This environment is only available from Helsenettet and not on the regular Internet.
HelseID / OAuth
Before you can start testing and using our API you need to register as a client of our service with HelseID using their self-service registration. They have their own documentation on how to proceed.
Ensure that you always utilize token exchange to access the API. Your token exchange client should be registered with the following permissions.
- API-Access:
Personvern og tilgangsstyring
- Audience:
nhn:pts
- Scope:
nhn:pts/api
(Currently default inselvbetjening
)
Example project for Token exchange:
- HelseID.Samples.
- Frontend / User login
- ApiAccess
- Note: Start this project with the following parameter:
dotnet run --use-token-exchange
- API That utilizes token exchange
- API that recieves the token exchange jwt
- Frontend / User login
- API-Access:
In cases where token exchange is not possible, you can alternativeley use Machine-to-Machine approach. Register your client with the followng details:
- API-Access:
Personvern og tilgangsstyring
- Audience:
nhn:pts
- Scope:
nhn:pts/api
(Currently default inselvbetjening
)
Example project for Machine-to-Machine approach
Note: Use this method only if token exchange is not posible.
- API-Access:
When your client is set up to use HelseID you should provide the negotiated OAuth token in the HTTP header
Authorization
as a bearer token on all requests to our service.
API Specification and Documentation
The inner details on our API is documented using OpenAPI specification. The details are available in our user interface representation of the specification here.
The APIs consists of two different main areas:
Test data
Our test environment is preloaded with some default test data. These test data will be periodically reset to their default value. The details about our default test data can be found in the general documentation.