question

newuser-763ca227-81d4-45e0-af0b-d007d0f75255 avatar image

SmartHomeSkillAPI: handleControl directive token Vs event token

I am using PowerController Interface.

In directive "TurnOn" directive, token mentioned as "access-token-from-skill"

<code>"endpoint":{"scope":{"type":"BearerToken","token":"access-token-from-skill"}

In event response for "TurnOn", it been mentioned as "access-token-from-amazon"

<code>"endpoint":{"scope":{"type":"BearerToken","token":"access-token-from-Amazon"}

Could someone help if "access-token-from-amazon" is the one we received in AcceptGrant or can it be sent as the same we receive in request?

alexa voice service
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Tsuneki@Amazon avatar image
Tsuneki@Amazon answered

Hi there,

Thanks for posting.

My apologies for delayed response.

There are two things to make sure.

1) Clarification between access token referred to as "access-token-from-skill" and "access-token-from-amazon". The "access-token-from-skill" and "access-token-from-amazon" are two different tokens. "access-token-from-skill" is the token sent by Alexa to the Smart Home skill so that the skill can validate and identify the user in the developer's system (see here for more information on what is "access-token-from-skill").

The "access-token-from-amazon" is only required when the skill wants to response to the directive asynchronously as described here, and it is sent by the Smart Home skill to Alexa so that Alexa can validate and identify the skill. 2) What is AcceptGrant? AcceptGrant directive contains OAuth2 authorization code which can be exchanged for the access token (a.k.a. "access-token-from-amazon") using Login With Amazon (LWA). See here for details.

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.