简体   繁体   中英

Alexa account linking with google API

I am currently working on linking my Alexa skill with google calendar api. I set up the account linking in the developer portal etc and I was able to link my account to the google api. However In order to use the google API, I need to have an accessToken.

Normaly Once the account is linked, I can get the accessToken in the JSON response in "this.event.session.user.accessToken" .

However when testing my skill (already linked with google ) in the amazon developer portal, in the JSON response there is no accessToken field but only userId.

Does anybody have a solution to this ? or any Idea to help dealing with account linking testing ?

Thank you in advance !

Is this a custom skill or a smart home skill? I don't know if the token is handled differently between the two, but in my smart home skill I am getting the token from event.payload.accessToken.

It's a custom skill. Actually the issue was that the accessToken wasn't sent to the right endpoint. Even if the account linking goes well, if the endpoint isn't correct than you won't be able to use the google API.

I had to enter the correct redirection URL given in the amazon developer console when configuring my skill, into my google project, now it works fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM