question

Lawrence Krubner avatar image
Lawrence Krubner asked

The skill must deliver a link account card to the Home section

The Certification team sent us these 2 bits of feedback: ------------------------------------------ ------------------------------------------ 4. The skill must deliver a link account card to the Home section when launched for users who have not yet linked an account. Please refer to test case 3.4 from the Submission Checklist for more information. 5. Currently when users who haven't linked search a company, the skill returns an error. While the skill mentions this is likely the result of lacking credentials, a link account card (see issue 2) should be delivered here and users should be informed to navigate to the Home section of the companion app to login with SalesVoice. ------------------------------------------ ------------------------------------------ I've been trying to imitate "users who have not yet linked an account" but I haven't managed to do it. If I disable the skill (via the Alexa app on my iPhone) and enable it again, but I don't fill in the form for Salesforce credentials, then I should be a "users who have not yet linked an account". But Amazon still seems to be sending me a user_id in the request that my app receives from Amazon. How can I be sure I've tested this correctly?
alexa skills kitsubmission testing certification
10 |5000

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

justin avatar image
justin answered
Hi Lawrence, Thanks for reaching out about this. Could you please clarify this last sentence: [pre]But Amazon still seems to be sending me a user_id in the request that my app receives from Amazon. [/pre] The user_id field is populated every time a skill is enabled on a device, regardless of account linking. This is non-static, and will generate a new user_id each time a user enables/disables a skill. The access token will respectively be wiped, since it is part of the user object in the session. If you're trying to test a user's login, you can validate any intent's accessToken. An example: [code] // Validate a token is present if (session.user.accessToken) { // Attempt to access requested data with token -- validation if(someValidationFunction(session.user.accessToken)) { // Success, pull necessary information from the request or offer output returned data. } else { // Route to login // Handle speech output } } else { // No token found // Route to login // Handle speech output }[/code] Apologies if I'm misunderstanding your request! Thanks, Justin
10 |5000

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

Lawrence Krubner avatar image
Lawrence Krubner answered
Thanks, Justin. So, if I understand the feedback from the Certification team, and I understand what you are saying, I can simply check for the access_token, and if access_token is not present, then I respond with: "card" { "type" "LinkAccount" } as part of the response. And that should be enough to answer this part of the feedback that the certification team gave us?
10 |5000

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

Lawrence Krubner avatar image
Lawrence Krubner answered
I'm trying to test this right now. I disable my skill, then I re-enable it. But I don't link an account. I believe this is what the Alexa Certification team is asking me to test: 1.) when the skill is enabled 2.) but the skill is not yet linked to an account But I can't seem to test it. Instead, Amazon keeps sending me these error messages: {:ssl-client-cert nil, :protocol "HTTP/1.1", :remote-addr "127.0.0.1", :params {}, :route-params {}, :headers {"x-forwarded-host" " alexa.salesvoiceapp.com", "host" " alexa.salesvoiceapp.com", "user-agent" "Apache-HttpClient/4.3 (java 1.5)", "content-type" "application/json; charset=utf-8", "accept-charset" "utf-8", "content-length" "473", "connection" "keep-alive", "accept" "application/json", "signature" "XWkhaBDr9tw8LI5vG/viE9gJ3dWfcU9BNMW2KB2v9CXVG+L60p2u+dPN80pxXRREMYh7KiyrNPp+/tNiEsb11gl3c2qVCCyXV9gMPeppjGqWcDEiTNPakn4PIywYAmzziAIbY4rqt7OnP1PUVO9Re0MjblvbOVq8OzDIUm2Uc5GeaOWBv2rRcEjiyZYezIntqeOzHgiJ7pHye/ayx6ZmadIeeY+KqdokEID/riy/5N5Bc4IIOzP7Ll5LCE4F6a9P6BvcSo/hlAeJV34XnrPQDi8WrcNOBc3MYcduRQ==", "signaturecertchainurl" " https://s3.amazonaws.com/echo.api/echo-api-cert-3.pem", "x-forwarded-for" "72.21.217.69", "x-forwarded-server" " alexa.salesvoiceapp.com"}, :server-port 80, :content-length 473, :form-params {}, :query-params {}, :content-type "application/json; charset=utf-8", :character-encoding "UTF-8", :uri "/chat", :server-name " alexa.salesvoiceapp.com", :query-string nil, :body {:version "1.0", :session {:new false, :sessionId "amzn1.echo-api.session.a25c7a7a-8ae9-4bb968", :application {:applicationId "amzn1.echo-sdk-ams.app.b9ae614a-bb4fbd"}, :user {:userId "amzn1.echo-sdk-account.AGKHJD6XZBJQ6I6IXMU"}}, :request {:type "SessionEndedRequest", :requestId "amzn1.echo-api.request.3efcf14", :timestamp "2016-01-22T18:42:47Z", :reason "ERROR"}}, (For security, I changed some of the ids to obfuscate the real values.) What is the correct response to this kind of message? Am I suppose to send a link card? Why is it SessionEndedRequest when no session has started?
10 |5000

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

justin avatar image
justin answered
Hi Lawrence, Sorry, but without having more details on when account information is being pulled, this is harder to understand. I'll try to summarize the flow, but this may not be fully applicable to your skill: User enables skill User launches skill User is automatically prompted with an account linking card User does not log in User invokes a part of your skill that assumes account information is present -- "Order me a pizza" Skill attempts to send access token for validation on your service, instead finds none / invalid response. Skill responds "Sorry, you don't seem to have an account set up with this service, or your session has expired. Please log in through the Companion app on your mobile device or browser" and replies with a card type of [i]LinkAccount[/i]. The same would also be true if the accessToken value is expired. Pleas see Responding to an Invalid or Non-existent Access Token https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/linking-an-alexa-user-with-a-user-in-your-system Apologies if this is all clearly apparent to you already! Any further details on what you are doing for us to evaluate is greatly appreciated. Thanks, Justin
10 |5000

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