Validate a Dutch Address

Now that you have an OAuth 2.0 Access Token you can validate your first VAT Number. Each API call requires you to send the Authorization token, in order to identify the caller of the API. As you may have already noticed in the result from the Access Token call, the Access Token is of type Bearer, so your HTTP requests to the API must include the Authorization header as follows:

Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz.......................

Make sure you insert the full token, which can be as long as a 1000 characters or more.

Next, we need the Dutch Address to check. An Ducthc address consist of two parts, Postal Code and House number. Let’s Postal Code “8758LD” and house number “1”

You send a GET call (in this case on developer enviorement)

https://api.valdit.com/api/v1/addresses/nl/:postalCode/:houseNumber

So the accutal call for this example would be:

https://api.valdit.com/api/v1/addresses/nl/8758LD/1

If all is well, the API will return a response with a HTTP response code 200 (Ok). The body of the response will hold the information on the structured address:

{
    "status": "success",
    "data": {
        "addressType": "address",
        "street": "Kanaalweg",
        "streetAbbreviated": "Kanaalwg",
        "houseNumber": 1,
        "postalCode": "8758LD",
        "city": "Allingawier",
        "municipality": "Súdwest-Fryslân",
        "municipalityCode": "1900",
        "province": "Friesland",
        "countryCode": "NL",
        "formattedAddress": "Kanaalweg 1, 8758 LD Allingawier",
        "bagNumberDesignationId": "0710200000157674",
        "bagAddressableObjectId": "0710010000157675",
        "geolocation": {
            "centroid": {
                "type": "Point",
                "coordinates": [
                    5.44582368,
                    53.04813722
                ]
            },
            "rdCentroid": {
                "x": 158930.877,
                "y": 562362.74
            }
        }
    }
}

That’s it, you have made your first call to the API! You are now ready to use the retuned information. The next chapters contain detailed information on how you can use the API to make more advanced calls.