Skip to content

Commit

Permalink
Updating address fetch service
Browse files Browse the repository at this point in the history
  • Loading branch information
stankut committed Jul 3, 2024
1 parent 3e384ba commit fd6a9c2
Showing 1 changed file with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,22 +51,18 @@ public static function create(ContainerInterface $container, array $configuratio
* {@inheritdoc}
*/
public function getMatrikulaId(string $addressAccessId) : ?string {
$url = "https://services.datafordeler.dk/BBR/BBRPublic/1/rest/grund";
$url = "https://services.datafordeler.dk/DAR/DAR/3.0.0/rest/husnummerTilJordstykke";

$configuration = $this->getConfiguration();
$json = $this->httpClient->request('GET', $url, [
'query' => [
'husnummer' => $addressAccessId,
'status' => 7,
'username' => $configuration['username'],
'password' => $configuration['password'],
'husnummerid' => $addressAccessId,
],
])->getBody();

$jsonDecoded = json_decode($json, TRUE);
if (is_array($jsonDecoded)) {
if (NestedArray::keyExists($jsonDecoded, [0, 'jordstykkeList', 0])) {
return NestedArray::getValue($jsonDecoded, [0, 'jordstykkeList', 0]);
if (NestedArray::keyExists($jsonDecoded, ['gældendeJordstykke', 'jordstykkeLokalId'])) {
return NestedArray::getValue($jsonDecoded, ['gældendeJordstykke', 'jordstykkeLokalId']);
}
}

Expand Down

0 comments on commit fd6a9c2

Please sign in to comment.