alexa / alexa-skills-kit-sdk-for-python

The Alexa Skills Kit SDK for Python helps you get a skill up and running quickly, letting you focus on skill logic instead of boilerplate code.
https://developer.amazon.com/en-US/docs/alexa/alexa-skills-kit-sdk-for-python/overview.html
Apache License 2.0
809 stars 204 forks source link

AccessToken attribute incorrect #34

Closed itsrickos closed 6 years ago

itsrickos commented 6 years ago

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[X] Documentation issue or request
[ ] Other... Please describe:

Documentation incorrectly labels the 'accessToken' attribute in the request envelope when it should be 'access_token'

Expected Behavior

Current Behavior

Possible Solution

Update documentation to reference accessToken = handler_input.request_envelope.context.system.user.access_token

Context

This is related to the AccountLinking process

timothyaaron commented 6 years ago

Would probably help if you could provide a direct link. I know I'm unable to find the specific page you're referencing. The only Python SDK doc I was able to find referenced the access token in ask_sdk_model.user, which identifies it correctly.

https://alexa-skills-kit-python-sdk.readthedocs.io/en/latest/models/ask_sdk_model.html?highlight=access#module-ask_sdk_model.user

nikhilym commented 6 years ago

@Rick-OS , can you provide the documentation link where this has to be updated?

nikhilym commented 6 years ago

Hey @Rick-OS , did you get hold of that doc link?

itsrickos commented 6 years ago

Hi All, Sorry it took a bit of time to track down where i saw the reference to accessToken. Based on the below we can probably close this issue as it doesn't appear directly related to the SDK doco. I was actually following the link to the JSON body request syntax from this page. https://alexa-skills-kit-python-sdk.readthedocs.io/en/latest/REQUEST_PROCESSING.html

The link sends you back to the following page where it references the accesstoken attribute. https://developer.amazon.com/docs/custom-skills/request-and-response-json-reference.html

Again, not sure if this needs to be updated for the sake of consistency, but thought id raise none the less. Thanks

nikhilym commented 6 years ago

Thanks for the response @Rick-OS . The request JSON is sent by the Alexa service to the SDK. The SDK deserializes it into request envelope model object. It is during this process, that the accessToken json key mapped to access_token model attribute. So, both the representations, in their corresponding docs, are correct.. Hope this explains the difference.

I am closing the issue. Please reopen in case you have any further questions about this.