googlemaps / google-maps-services-go

Go client library for Google Maps API Web Services
https://pkg.go.dev/googlemaps.github.io/maps
Apache License 2.0
737 stars 214 forks source link

ReverseGeocode: invalid character 'U' looking for beginning of value #276

Closed ssengalanto closed 1 year ago

ssengalanto commented 1 year ago

Thanks for stopping by to let us know something could be better!


PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


Please be sure to include as much information as possible:

Environment details

OS: MacOS version 12.4 Library version: googlemaps.github.io/maps v1.3.2

Steps to reproduce

  1. Get valid places_id using https://developers.google.com/maps/documentation/places/web-service/place-id
  2. Call ReverseGeocode with PlaceId field

Code example

result, err := c.maps.ReverseGeocode(context.Background(), &maps.GeocodingRequest{
    PlaceID: placeID,
})
if err != nil {
    c.log.Error("reverse geocode failed", map[string]any{"placeId": placeID, "error": err})
    return nil, err
}

Stack trace

2022-12-29T12:54:34.248+0800    ERROR   v1/create_account_handler.go:134        reverse geocode failed        {"placeId": "ChIJ5aafxfvJlzMRf5AABl43Sxs", "error": "invalid character 'U' looking for beginning of value"}

Following these steps will guarantee the quickest resolution possible.

Thanks!

wangela commented 1 year ago

@ssengalanto Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.

ssengalanto commented 1 year ago

I tried using API key instead of client ID & secret and it works now, will be helpful to return an error that it fails to connect to client, thank you.