Traffic time from Google API


#41

Sorry wasn’t looking for the whole piston. What happens if you take your composed url and type it into the address bar?


#42

Got it! Silly me, I inadvertently forgot to actually enable the API despite getting the key!. Thank You for your help.


#43

I created a piston to assist my gf when heading to work. She may have to go to 2 different locations, maybe based on traffic. I am able to get a single origin with multiple destinations to work with the | pipe character to work via the URL and I can get a single destination to work via using an expression in WebCoRE. When I try to use the pipe character, I get errors in the WebCoRE logs. This is the actual error log statement:

Error executing external web request: java.net.URISyntaxException: Illegal character in query at index 175: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins=45.015840673431,-93.4524465678222&destinations=45.0757839,-93.44992539999998|45.01056,-93.48695959999998&key=KEY

See my example below.

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins=44.7326303%2C-93.15094820000002&destinations=605%2028th%20Ave%20N.%20Plymouth,%20mn%2055447|6655%20Wedgwood%20Rd%20N,%20Maple%20Grove,%20MN%2055311&key=KEY

The basic format is: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins=ORIGN&destinations=DESTINATION 1|DESTINATION 2&key=KEY

This is the current expression I am using that works with the single destination:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins={startLatitude},{startLongitude}&destinations={605Address}&key=‘{api_key}

I used to have:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins={startLatitude},{startLongitude}&destinations={605Address}|{WedgewoodAddress}&key=‘{api_key}

I also tried putting the pipe in single quotes:

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&departure_time=now&origins={startLatitude},{startLongitude}&destinations={605Address}’|’{WedgewoodAddress}&key=‘{api_key}

I have also tried making a combined address variable {45.0757839,-93.44992539999998|45.01056,-93.48695959999998}, but I get the same error as above.

The repsonse will come back like this:

Where I wanted to set variables for the durations like this:

{DurationWithoutTraffic1} = rows[0].elements[0].duration.value
{DurationWithoutTraffic2} = [0].elements[1].duration.value
{DurationWithTraffic1} = rows[0].elements[0].duration_in_traffic.value
{DurationWithTraffic2} = rows[0].elements[1].duration_in_traffic.value


#44

The given details regarding the Google API is very detailed and the thing is that there are many users and developers who are not aware of that and they will be informed through this. The Microsoft compatibility telemetry high disk issue could happen if the system is not modified through the Google API.