Get Location From Pdok gives unauthorize error

i am mapping polygon on my local machine using following api{BAG_ID}
and in header i am passing api key in following way
headers: {
‘X-Api-Key’: PDOK_API_KEY,
‘Accept’: ‘application/hal+json’
it shows me error like You don’t have permission to access /api/v1/verblijfsobjecten/0268010000012268 on this server.

This BAG API doesn’t exist anymore.
The new version of the BAG API is:
At this moment it doesn’t support requests with a polygon.

@NicoleKortoomsBAG is there any alternate way to get polygon coordinates? btw new api works fine with some changes in json response. appreciated your help.

Maybe the BAG WFS service has the functionality you need.