Search code examples
geocodinggoogle-geocoding-api

"Unable to authenticate the request" with new Geocoding service with optional parameter "new_forward_geocoder"


We can try the new Geocoding service ahead of launch by adding an optional parameter, new_forward_geocoder=true, in Geocoding API request.

When i try optional parameter new_forward_geocoder with url https://maps.googleapis.com/maps/api/geocode/xml?new_forward_geocoder=true&address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&key=API_KEY then i am getting result

but when i try with url https://maps.googleapis.com/maps/api/geocode/xml?new_forward_geocoder=true&address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&client=CLIENT&signature=SIGNATURE&channel=CHANNEL then i am getting error -

Unable to authenticate the request. Provided 'signature' is not valid for the provided client ID, or the provided 'client' is not valid. The signature was checked against the URL: /maps/api/geocode/xml?new_forward_geocoder=true&address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&client=CLIENT If this does not match the URL you requested, please ensure that your request is URL encoded correctly. Learn more: https://developers.google.com/maps/documentation/business/webservices/auth


Solution

  • I found my mistake. I can't append any parameter to existing request. I have to calculate signature again after appending a new parameter

    I have to add the parameter in URL before signature calculation.