Select to view content in your preferred language

ArcGiS Developer Account API Key for Geocoding

280
1
09-26-2024 09:49 AM
Labels (1)
thxmike13
Emerging Contributor

I am attempting to setup a simple nodejs application to geocode addresses, which is based on the following blog post

https://www.esri.com/arcgis-blog/products/developers/developers/find-address-coordinates-using-node-...

In doing so, I went through the process of setting up an account then setting up an ApiKey with my developer account. I also gave it access to the geocoding feature. However in every case, I keep getting an error 

ArcGISAuthError: 498: Invalid Token
at checkForErrors (***/test-arcgis/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:145:23)
at /***/test-arcgis/node_modules/@esri/arcgis-rest-request/dist/cjs/request.js:366:30
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
originalMessage: 'Invalid Token',
code: 498,
response: { error: { code: 498, message: 'Invalid Token', details: [] } },
url: 'https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates',
options: {
httpMethod: 'POST',
params: {
f: 'json',
address: 'N Main st',
postal: 38103,
countryCode: 'USA'
},
authentication: ApiKeyManager {
portal: 'https://www.arcgis.com/sharing/rest',
key: '***jGmAOVb'
},
headers: {}
}
}

I am not quite sure how to resolve this or determine if I set it up correctly 

I have gone through a series of online resources and have not been able to find the correct way to set this up.

Any assistance is appreciated.
Any assistance

Tags (1)
1 Reply
AlertMediaDev
Emerging Contributor

Same issue... the docs suggest you can use an api key or an access token, but it does not accept the api key.  This can be caused by incorrect referrers. 

0 Kudos