lvbag / BAG-API

Welkom op het platform waar de technische documentatie over de BAG API Individuele Bevragingen gepubliceerd wordt.
55 stars 19 forks source link

Precondition failed: acceptCrsMissing #51

Closed arkoe closed 2 years ago

arkoe commented 2 years ago

Hi,

I am trying to integrate the BAG API into our product to lookup address information. When I query adresseerbareobjecten I get the error 412:

{
  "status": 412
  "title": "Gewenste coördinatenstelsel voor geometrie moet worden opgegeven."
  "type": "https://tools.ietf.org/html/rfc7232#section-4.2"
  "detail": "Precondition failed."
  "instance": "https://api.bag.acceptatie.kadaster.nl/lvbag/individuelebevragingen/v2/adresseerbareobjecten?accept-Crs=epsg%3A28992&nummerAanduidingIdentificatie=1674200000047 ▶"
  "code": "acceptCrsMissing"
}

Even though I do include the Accept-Crs header in my request:

$response = Http::get($this->getApiUrl() . "/adresseerbareobjecten", [
    "X-Api-Key" => $this->getApiKey(),
    "Accept-Crs" => "epsg:28992",
    "nummerAanduidingIdentificatie" => $nummerAanduidingIdentificatie,
]);

I am unsure what I'm doing wrong, hope there is anyone who faced this issue before and is able to help me out.

Kind regards,

Arko

Bas2021 commented 2 years ago

Hi,

Did you resolve this issue? I'm stuck with the same problem...

Kind Regards,

Bas

AVee commented 2 years ago

Accept-Crs needs to be send as a HTTP header, not a query parameter. I'm guessing thats where you go wrong (it's what I did initially).

NicoleKortoomsBAG commented 2 years ago

I will close the issue. We checked the API and the logging and the API seems to work as intended. On https://geoforum.nl/t/bag-api-v2-foutmelding-412-in-azure-logic-apps you'll find the related issue of Bas2021 with the conclusion that it might be a bug in Azure that is causing this problem.