How to use
Adrescheck Basis Nationaal
Adrescheck Basis Nationaal
You access PostNL DataSolutions API’s without writing any code. Just use this .json file import this in Postman on your preferred OS.
Your test account allows you to play with input & output. By default this test account is limited to 250 calls. In case of questions, use the contact details sent to you by email to confirm your (test)account. After setting up your API, please read the Documentation tab to find a Postman import file, samples and field details.
If testing went well and you like what you see, you can apply for a paid production account. In order to fully integrate the API’s into your website, e-commerce platform and/or backend application(s), you need a production account. While registering as a PostNL customer you receive personalized login credentials for API Manager, for accessing and managing your API key(s) and quota.
Do you already have a PostNL DataSolutions contract number and you don’t use the PostNL DataSolutions API’s? Please contact your Account Manager or fill out this form. See API Manager for managing your keys and usage.
This product offers two API’s.
1. postalcode - If the requested address exists within a postal code range this API returns status, streetname, city and area code based on requested postalcode and housenumber.
2. cityStreetName - This API returns NEN streetname and NEN City name based on requested postalcode.
See Documentation for detailed API settings and fields.
If you prefer a more thorough address check, to ensure not only a fit within a range, but also validate the actual existence of a Dutch address, please use Adrescheck Nationaal.
Calling a service
A service is called by sending a message to a service endpoint. The message contains a header with your APIkey (apikey) and ContentType (application/json) and a body which contains the service method and related parameters.
Below you can see examples of the header and body, within Postman (an API tool to visualize APIs). Please note: the content used is purely for illustration purposes.
See the example header below.
* You can replace “{{apikey}}” with your API key, or choose to keep {{apikey}} and define your API key in the Postman Environments
* You can replace “{{URL}}” with the url of your API, or choose to keep {{url}} and define the url in the Postman Environments Note that url is a combination of the basic path – https://api.postnl.nl – followed by the address of each specific API. Be sure to use your CAPS wisely.
Each message that is received by the API is authenticated and authorized. This mechanism determines if the user has access to the requested service.
Use the ‘Manage environments’ in the top-right corner, to setup up the common part of the url: https://api.postnl.nl
Now you are ready to test.After processing the request, the service will return a message with a response. The message contains a body with the information.
Here’s a POST-example body with input and output. Adjust the fields to your specific API accordingly:
Be aware that some API’s use a POST method and others use GET. In case of GET, define your parameters like this, to your specific API accordingly:
Parameter specification & field order
It is advised to maintain the exact order of the fields as specified in the documentation tab. Changing the order of fields can result in unspecified errors returned back at the client.
Access
Each API is secured with an API key. Your account for managing keys and credits is secured with a username and a password via API Manager.
In case of questions about API Manager, use the contact details sent to you by email to confirm your (test)account.
Example code
The Adrescheck Basis Nationaal uses a GET method (as in: not POST).
PHP
Find the demo code here to get your project started.