Testing ID-Card API#
On this page
To be able to test the integration we need a way to create QRCodes on demand. We have therefore made an endpoint that creates QRCodes based on some dummy users. This endpoint is only available in test environment.
Getting Test QR codes#
Use /api/qrtest/{userNumber} to generate QR-Codes that can be scanned. The userNumber should be replaces with on of the pre-defined users bellow.
List of valid test users
| User Number | Name | Gender | Dob (yyyy.mm.dd) | Age |
|---|---|---|---|---|
| 1 | EDGAR HETLAND | MALE | 1980-09-02 | 43 |
| 2 | ANNETTE INGVILD BERGAN | FEMALE | 1994-09-02 | 29 |
| 3 | JAKOB HALVORSEN | MALE | 2010-03-05 | 14 |
| 4 | NORA SOLBERG | FEMALE | 2005-09-14 | 18 |
| 5 | MADS HANSEN | MALE | 2009-02-11 | 16 |
In this example we are getting a QRCode of user number 2.
The response model consists of the QRCode as a byte array. ttl or time to live, this indicates how long the QRCode is valid in seconds. ts is a timestamp of when the QRCode was made in epoch-time. We also return the sessionId embedded in the QRCode as plain text, for the cases where a QRCode scanner is not available during testing.
Postman Collection#
To make it easier, we have created a Postman collection you can use to generate a BankId OIDC Token and test QRCodes as described above.
To use the Postman Collection, you will need to have obtained the client_id and client_secret from us. (Read more)
Setting up the Postman Collection#
-
Open Postman, select 'Import,' and import the collection you downloaded from the link above. Alternatively, you can drag and drop the collection.json file into the Postman window.
-
Fill in missing
client_id,client_secretand thescopeparameters in the body of the ID-card Test POST as shown bellow:
- Add QRCode visualization to the Post-Response script of the ID-card Test GET request to display the QRCode

Using the Postman Collection#
- 1
Make a call to the ID-card Test POST with
client_id,client_secret, andscopeto recieve anaccess_tokenin the response.
- 2
Use the ID-card Test GET request with the
access_tokenset in the Authorization field using Bearer Token Auth.
- 3
Check the Visualize tab in the Body section to see the QRCode.

Using a QRCode#
Now that we can generate QRCodes, they can be scanned as you would with a real user and get a sessionId.
Use that sessionId in api/merchant/session-endpoint to get the user data for that test user.
In this example we have a sessionId for user number 3.