Get CPR certified in 30 minutes at CPR Test Center.
Echo & Alexa Forums

Using outside the US

0 Members and 1 Guest are viewing this topic.

stonewater

Using outside the US
« on: October 24, 2015, 08:53:32 am »
So I got myself an Echo Yesterday in Seattle and it's now safe and sound back in London.

But obviously as nice as it is to know the weather in Seattle - I immediately started to play....

Apologies if this has been documented elsewhere on the forum but I couldn't find before posting.

I'm having some success meddling with the address, country and timezone.

You'll need to arm yourself with a copy of request maker for Chrome so that you can mess with the API post requests.

With request maker installed you'll need to visit http://alexa.amazon.com/

Go to the settings for your echo and update the address - chose a US address - the seattle defaults are fine.

Open request maker and you'll see a call to https://pitangui.amazon.com/api/device-preferences/

You can now tamper with the raw data of the post request.

Thus far I've found that setting timezone (which is set by default to null) will OVERRIDE the timezone for the address.

Which means I can ask the time etc and get local london time ;-)

(To see which timezone is correct for you visit https://pitangui.amazon.com/api/available-time-zones?_=1445689862656).

The raw text that I'm using is.

{"deviceAccountId":"XXXXX","deviceAddress":"23 Wenlock Road, London, N17","deviceAddressModel":{"city":"London","countryCode":"UK","county":"London","district":"Hackney","houseNumber":"901","label":"23 WA-305 NE, Bainbridge Island, N1 7SZ, United Kingdom","postalCode":"N1 7SZ","state":"London","street":"WA-305 NE"},"deviceSerialNumber":"XXX","deviceType":"AB72C64C86AW2","firstRunCompleted":true,"postalCode":"98110","responseStyle":"CONCISE","searchCustomerId":"XXXX","temperatureScale":"CELSIUS","timeZoneId":"Europe/London","voiceCastEnabled":null,"autocastToThisClient":false,"isSaveInFlight":true}

As you can see - I've varied a number of parameters which get considerably closer to my address.  The API seems really sensitive to changes to the "label" field - although I've successful updated my postcode to the extent that it shows via the alex.amazon.com site.

It's not quite working for weather but I think it's probably going to be fairly easy to reverse engineer what the API is looking for.

You can mess around yourself - if you get a 200 code then the API has accepted it - 400 means no.

I'll keep looking at this and update what I find.

David
« Last Edit: October 24, 2015, 08:58:52 am by stonewater »

stonewater

Re: Using outside the US
« Reply #1 on: October 24, 2015, 09:00:18 am »
Sorry - I should have said you can't just copy the raw data I used - you'll need your own customer id / device id etc / (maybe) model number although it doesn't seem to do anything - I can change it and the change is retained.

There's probably a model number for internal testing versions if anyone can find it - I haven't really tried.

pez

Re: Using outside the US
« Reply #2 on: October 25, 2015, 07:07:16 am »
This is awesome - it hadn't occurred to me to try crafting my own api requests like that. I have now managed to set my timezone properly - thanks!

I haven't managed to get it to accept my address properly yet. What effect did that have for you? You said that weather still doesn't work? What about nearby restaurants?

A lot of stuff seems to be driven off the top level 'postalCode' which I can not seem to to accept anything other than US zip codes - is that your experience too?

Also, how did you manage to find the 'available time zones' section of the api?

Anyway, thanks again, just getting the timezone working is awesome.

kahus

Re: Using outside the US
« Reply #3 on: November 16, 2015, 09:39:31 am »
how do i edit the source code to put in my country's timezone?
thanks very much for this very informative post, although i am not an IT guy, i am tring to make this to work, i can't seem to figure out how to edit it

kickmaleerie

Re: Using outside the US
« Reply #4 on: November 19, 2015, 06:59:08 pm »
Thanks for posting this.

I am no programmer but I have used your guide and Request Maker in Chrome to intercept the POST and set the "timeZoneId" parameter to UK GMT using the zone "Europe/London"  so Alexa now tells me the correct time :-)

Are the parameters used in the API documented anywhere? How did you decide on the parameters to use in the "deviceAddressModel" parameter and in the label

TIA

john

migmog

Re: Using outside the US
« Reply #5 on: November 21, 2015, 06:44:19 pm »
Brilliant!
It took me a while to figure out how to open Request maker - it puts an envelope icon on the right side of the address bar. If you click on this you get a list of the POST, GET and PUT actions that have happened on that page. I just clicked on the PUT and edited "timezone":null to "timezone":"Europe/London".

That is inspired thinking!
Thank you, David

litfoo

Re: Using outside the US
« Reply #6 on: November 22, 2015, 05:36:27 am »

Have managed to get this working - Excellent work David

"timeZoneId":null to

"timeZoneId":"Europe/London"

Looking forward to hearing any updates regarding getting the weather outside the US to work

thanks again




amrhady

Re: Using outside the US
« Reply #7 on: November 25, 2015, 02:07:10 am »
Thanks for the post David. Can you cofirm, with this trick, if you managed to get local features working? Like resturants, traffic, etc...?

To get local time in London, I just say "time in london"  and same for weather.

goblinant

Re: Using outside the US
« Reply #8 on: November 27, 2015, 09:46:51 am »
Thanks for this,  will have a play over the weekend and see what I can tweak  :)

Antony

nurcopolics

Re: Using outside the US
« Reply #9 on: November 28, 2015, 03:49:46 pm »
This is the final piece of he puzzle for making the echo perfect for me. I've installed the chrome extension but dont see the envelope icon to to he right of the url. When  I open the website  from the , I   get a '401 authorisation error' in the request maker. Anyone else not getting the envelope to edit because of an authorisation error?
« Last Edit: November 28, 2015, 04:02:12 pm by nurcopolics »

nurcopolics

Re: Using outside the US
« Reply #10 on: November 28, 2015, 04:11:33 pm »
When I paste in the new Timezone I get 'message null' and nothing changes... What am I doing wrong?

BKL

Re: Using outside the US
« Reply #11 on: December 07, 2015, 04:55:50 am »
Has anybody been able to change their location to outside of the USA?
I have managed to get the time zone changed, (I'm in Australia).
But anything else is proving to be difficult.
If anyone has been successful it would be great to hear.. :)

Cheers..

BlueZulu

Re: Using outside the US
« Reply #12 on: February 05, 2016, 05:07:00 pm »
Thanks David this is awesome!

I like this fix not so much to tell the time but more for my Calendar so it doesn't tell me i have to pick up the kids like 3 a.m. in the morning or something!

Haven't checked but my alarm should work properly too!

BlueZulu

Maff

Re: Using outside the US
« Reply #13 on: February 07, 2016, 04:47:47 pm »
I've got the timezone working too now, but not the location . The api seems not to like anything other than a US zip code in the right place just like the main app. I did read that the alexa app takes GB instead of UK as a country code. (I adjusted my text string and it did accept GB where it hadn't accepted UK before) I googled "country codes amazon alexa api" and came across a developer thread where someone had posted all of the country abbreviations. Don't know if that helps the OP get any closer. Also I did notice the API text strings on other submissions were putting a + sign instead of a space in the UK postcodes. I wondered if this or an underscore might work better when typing a UK postcode in, as these strings of text don't look like they allow spaces.

Maff

Re: Using outside the US
« Reply #14 on: February 07, 2016, 05:28:13 pm »
Slight side topic, but within this same text string, I noticed a code for voice casting. This is normally only allowed with fire tablets & in my string is set as above. In the original posters post (returning a null/false). Can't help wondering if this was set to "true" and a given a named correct client it may enable voice casting on a non-fire android tablet?

Has anyone given this timezone method a go, who owns/uses a kindle fire tablet too? Would be interesting to see the correct client name and how it appears in your api text string to see if it is as easily edited as the timezone part.