Hi Jan/Alex/everyone,
This is Simon from Smixon Ltd. I’m new to the community, currently building a cross-platform voice app for one of our clients.
Made some good progress so far. Have set up AWS Developer account, AWS Lambda function / Jovo webhook as endpoints, and also have an Amazon Merchant Account with Access ID and Secret Access Key. ASK-CLI, Jovo-CLI have been fantastic tools so far, as well as the Jovo debugger. We’ve built up the basic logic/functionality of our app directly with the Jovo language model. This involves giving some information/instructions to our users, followed by asking if they would like us to add a certain product to their Amazon basket.
Today, using the alexaSkill manifest in our project.js file, we have enabled read/write permissions to user household lists, and also enabled the Display Interface for when we want to display images or get permission from our users.
Now we’ve hit a bit of a brick wall in terms of progress, and we’re hoping to get it fixed ASAP with some help.
Here’s what we want to do:
- Ask user if they would like to add a product to their basket.
- Use a followUpState(‘AddItemToBasketState’) to process the user YesIntent() or NoIntent().
- If yes we need to check for permission to use Amazon Pay, if denied, we need to send a List Permissions card to them to enable permission.
- Add item to their basket.
Initially, we want to get this working with just voice (Echo Dot), but we can add in the images/animations later for Echo Show etc. Reading through the Jovo docs today, we can see that the Jovo helper methods described on the Amazon Pay page [https://www.jovo.tech/docs/amazon-alexa/pay] could be useful to us. But the documentation here is limited, and going to the Alexa Skill Kit reference [https://developer.amazon.com/docs/amazon-pay/amazon-pay-overview.html] has left us unsure what to do.
We know that we have to gain permission from the user, then send a setupDirective… Honestly, we don’t know where to start with the next stage!
There’s also the issue of whether we need to use the Amazon Presentation Language. Or can we just use card templates? So confusing!
Here’s a snippet of our code, described above. Unfortunately we can’t give the entire sample of code as the project details are private to us and our client. Hopefully this snippet will be enough for now:
.addText(
"Would you like me to add a bottle of " + productType + " to your basket?"
);
this.followUpState('AddItemToBasketState').ask(speech);
},
AddItemToBasketState: {
// This is where we would like to start adding items to our user's basket, instead of just using the
// this.tell() method. The only reason that is there is because we we're testing everything was working
// with the followUpState.
YesIntent() {
this.tell('Okay, item added to basket.');
},
NoIntent() {
this.tell('No problem.');
},
}
Any help would be greatly appreciated as we are short on time with a deadline coming up soon. If we can demonstrate that we can add products to a user’s basket, I think our client will be satisfied that we have got this part to work.
Many thanks in advance,
Simon Revill
Smixon Ltd