12
Views
1
Comments
Google Distance Matrix API setup assistance
Question
Application Type
Reactive

Hi,

I have installed the Google Distance Matrix API from the forge. Setup a REST API to connect to Google Maps (maps.googleapis.com). I have the API keys and have successfully used them with the Maps and Get Directions. 

I just can't figure out how to configure the Distance Matrix API settings to get it to work correctly. 

Looking for help with the REST settings and the Action Logic. 

Hope that makes sense and you can help.

Thanks,

Glenn

2021-04-09 11-42-43
assif_tiger
 
MVP

Hi @Glenn Southward
At very first if this is something related to forge than in that case you should have posted this under forge section of respective component :)


Considering u are using this forge :
https://www.outsystems.com/forge/component-overview/1498/google-distance-matrix-api-o11


URL:

https://maps.googleapis.com/maps/api/distancematrix/json  ?destinations=New%20York%20City%2C%20NY  &origins=Washington%2C%20DC  &units=imperial  &key=YOUR_API_KEY

Here the action GetDrivingDistanceAndTime requires

- OriginAddress : You can pass a comma separated text string
                                ex: "Washington, DC, USA"


- DestinationAddress : You can pass a comma separated text string 
                                        ex:  "New York, NY, USA"

----------------------------
The Rest Consumer endpoint has additonal params too which is not covered by this GetDrivingDistanceAndTime action. You can refer them directly as per your requirement. ex: mode, unit & departure_time



Ref:
https://developers.google.com/maps/documentation/distance-matrix/start#openapi-spec
https://developers.google.com/maps/documentation/distance-matrix/overview


Good Luck

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.