Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

Sending a destination with no address to Tesla

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
A question for any techies/programmers here...

We are developing a navigation-related app that can send destinations to Tesla. I couldn't find any documentation about the list of formats accepted by the app, but from my testing, it seems to accept addresses shared from various apps (e.g. from Google Maps, Apple Maps, Waze, etc.) and, the most interesting for our use case, proprietary Google Maps shortlinks, like this:


(what you see above is the shortcut already resolved, the actual link is ---https://goo.gl/maps/x6FJb1KxMvQRoXhZ6--- without the dashes)

This is the format Google uses when you drop a pin on the mobile version of Google Maps and choose "Share". Unfortunately, these links seem to be proprietary, I have no idea what algorithm Google uses to create them, or if they provide API access to it.

We have been trying to find out what these links are called and how to create them through the Google API, as this is the only way we found so far to send a destination to Tesla that doesn't have a precise street address - but so far, no luck.

Does anyone know what these links are called? Any programmers here who happen to know how to create these through Google API? And, is there any other location format for places with no address that Tesla will accept?
 

AlexParker

Member
Aug 5, 2020
180
126
Denver, CO
Based on the docs, I think these are just short links that are like KV pairs. They say the same destination will change short links dynamically. So it probably returns a real link that Tesla…since it uses Google Maps anyway… resolves.
 

jmaddr

Active Member
Mar 29, 2019
1,041
1,055
Florida
Are you trying to send the directions directly from your app? Couldn't your built in app just use the existing share sheets? I'm guessing you are trying to use the api here:
But I would use the existing share sheets as anything can change with the APIs since nothing is official. You would also have to deal with the two factor authentication issues and teslas ever changing captcha requirements (Teslamate and TeslaFi deal with this on a regular basis)
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
Are you trying to send the directions directly from your app? Couldn't your built in app just use the existing share sheets? I'm guessing you are trying to use the api here:
But I would use the existing share sheets as anything can change with the APIs since nothing is official. You would also have to deal with the two factor authentication issues and teslas ever changing captcha requirements (Teslamate and TeslaFi deal with this on a regular basis)
Yes, we are using the share sheet to send to the Tesla app, not the "unofficial" API - I wouldn't use that since it can break at any time without warning, plus there are the other complications you mentioned.

The only issue is that the Tesla app (through the share sheet) doesn't seem to accept coordinates or any other "universal" location format. The only way I found to send a location with no address is by using the proprietary Google short links which I manually created in Google Maps for iOS. So far I couldn't find what they are called, and if there is a Google API we can use to create them.
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
Based on the docs, I think these are just short links that are like KV pairs. They say the same destination will change short links dynamically. So it probably returns a real link that Tesla…since it uses Google Maps anyway… resolves.
Where did you find this info (the "they say" part in your comment)?

Yes, that's how it works - the links are just resolved into coordinates, e.g.
.https://goo.gl/maps/x6FJb1KxMvQRoXhZ6 --> .https://www.google.com/maps/place/25°07'30.6%22N+80°24'10.2%22W/@25.1251616,-80.4050088,17z

I'm trying to find a way to do this the other way around, i.e. turning the second link above into the first one since Tesla ONLY accepts the first one and not the second (resolved) link.
 

AlexParker

Member
Aug 5, 2020
180
126
Denver, CO
I just looked at their docs and I know innately how short links works. It’s server side. You can ask Google to make the link and send that - but you can’t create the links without involving Google.
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
I just looked at their docs and I know innately how short links works. It’s server side. You can ask Google to make the link and send that - but you can’t create the links without involving Google.
Yes, that is definitely the case. There is no algorithm, it uses Google's own (deprecated, for public use, as far as I understand) the goo.gl link shortener. So it is most likely a server side assignment of a random string, which is then resolved on the server to the original Google Maps deep link that it was assigned to. What I couldn't find info about anywhere is, if there is a way to create those short links using Google's API.

And what truly baffles me is that the car seems to accept the goo.gl short links for map locations, but not their resolved original Google Maps deep link counterparts.
 

AlexHung

Member
Mar 13, 2021
358
350
Santa Cruz, CA
Yes, that is definitely the case. There is no algorithm, it uses Google's own (deprecated, for public use, as far as I understand) the goo.gl link shortener. So it is most likely a server side assignment of a random string, which is then resolved on the server to the original Google Maps deep link that it was assigned to. What I couldn't find info about anywhere is, if there is a way to create those short links using Google's API.

And what truly baffles me is that the car seems to accept the goo.gl short links for map locations, but not their resolved original Google Maps deep link counterparts.
I told a quick look at Google Maps API doc yesterday and could not find one to create the short link. I’ve used Google Maps API before so I know they have deprecated a bunch of stuff and started charging too 😀.
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
I told a quick look at Google Maps API doc yesterday and could not find one to create the short link. I’ve used Google Maps API before so I know they have deprecated a bunch of stuff and started charging too 😀.
That's unfortunate. I guess we will have to see what other format can be sent to the Tesla app that covers non-address destinations (coordinates only).
 

holgerkruse

New Member
Aug 2, 2021
3
5
San Mateo, CA, US
This is rather strange. Apparently Google resolves those links differently depending on which browser/client is asking for it. If you resolve your shortcut link with "wget" you will get a redirect to the following link instead:


Try that format instead.

The explanation why the other resolved link (the one you see in browsers) may not work with the Tesla app might be that it contains embedded non-ASCII characters, specifically the degree character, which would require UTF-8 encoding in the link itself (and then escaping to "%C2%B0" in the URL on the wire). The Tesla app may not support that via the share sheet.
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
This is rather strange. Apparently Google resolves those links differently depending on which browser/client is asking for it. If you resolve your shortcut link with "wget" you will get a redirect to the following link instead:


Try that format instead.

The explanation why the other resolved link (the one you see in browsers) may not work with the Tesla app might be that it contains embedded non-ASCII characters, specifically the degree character, which would require UTF-8 encoding in the link itself (and then escaping to "%C2%B0" in the URL on the wire). The Tesla app may not support that via the share sheet.
Thank you - I tried it. I get a "No results found for this search" on the car. This whole setup is strange indeed. I don't understand why it wouldn't accept a Google Maps link, but accept the goo.gl short link that redirects to the very same URL...
 

with_raiden

Member
Apr 11, 2021
227
199
NYC
I am sure you're aware that sending direction from Apple Map works with the Tesla App / Cars too. That doesn't use the short url that Google uses.

The Apple Map URL looks something like this New York to Inwood Hill Park

I think daddr is used for destination address while saddr is address of origin.
 

SilentFlight

Member
Sep 5, 2021
128
60
Netherlands
I am sure you're aware that sending direction from Apple Map works with the Tesla App / Cars too. That doesn't use the short url that Google uses.

The Apple Map URL looks something like this New York to Inwood Hill Park

I think daddr is used for destination address while saddr is address of origin.
Yes, I tried Apple Maps too. However, the URL Apple Maps sends includes quite some data, depending on what's the location you are sharing. It seems to always include the address. I specifically tried locations in the middle of nowhere, and that sends both coordinates and the nearest known address, in some cases, only a city and postal code. In those cases, Tesla doesn't use the coordinates as the destination, but the address - which, in this case, can be widely inaccurate, e.g. 20 miles off in one case that I tested. Instead of the coordinates 20 miles away from the nearest town, the car set the destination to the center of the nearest town. If I remove the address and only leave the coordinates encoded in the URL, I get an error message - the Tesla app doesn't process it.
 

Products we're discussing on TMC...

About Us

Formed in 2006, Tesla Motors Club (TMC) was the first independent online Tesla community. Today it remains the largest and most dynamic community of Tesla enthusiasts. Learn more.

Do you value your experience at TMC? Consider becoming a Supporting Member of Tesla Motors Club. As a thank you for your contribution, you'll get nearly no ads in the Community and Groups sections. Additional perks are available depending on the level of contribution. Please visit the Account Upgrades page for more details.


SUPPORT TMC
Top