What are all the steps involved with changing an Alexa Skill name? - amazon-web-services

I submitted a skill to Amazon for Alexa, and it failed certification due to intellectual property rights. Amazon suggested that I say the service is "for" the IP rights holder, so I modified the name and am now getting this error for everything I try to do.
{
"errorMessage": "Exception: TypeError: Cannot read property 'application' of undefined"
}
So far, I updated the Skill Name, Invocation Name, and Welcome Message. Is there something else I need to update or run on the dev portal to get this to work again?
Update: When I try to start the skill from the Alexa Development portal, I see this in the logs for
console.log("event.session.application.applicationId=" + event.session.application.applicationId);
{
"version": "1.0",
"session": {
"new": true,
"sessionId": "SessionId.8b65b2f5-0193-4307-9bef-88c116d9344b",
"application": {
"applicationId": "amzn1.echo-sdk-ams.app.5987b947-c8e9-4fc4-a0b8-2ba12c57ea59"
},
"attributes": null,
"user": {
"userId": "amzn1.ask.account.ABCDEFG" // masked my account value
}
},
"request": {
"type": "IntentRequest",
"requestId": "EdwRequestId.4d19f589-cdca-4303-99dc-0dc5cec781d2",
"timestamp": "2016-04-18T16:21:04Z",
"intent": {
"name": "DontKnowIntent"
}
}
}
The application ID matches the one supplied in the Alexa Development portal, so I don't think that's causing any issues. The property 'application' is only ever called after 'session', which clearly is defined. I don't know if the null attributes is causing an error. Maybe someone can look at a successful request?
Finally, here is my code: https://github.com/Shwheelz/alexa-skills-kit-js/blob/master/my_skills/pokemonTrivia/src/index.js

I have changed the name twice before on a node app and a Java 8 app. All I had to do was change the name (also changed invocation name) under the skill information. It worked first time out. Now my skill name did not update on alexa app once and did the other time. Since you are not certified, you may want to create the skill for scratch. This should only take about 5 or 10 mins. Just do not forget to change or add the new application Id of you lambda

Related

Google my business not fetching reviews correctly

I'm currently using Google's api for fetching reviews of a Google My Business Account. We do this for our clients, which have to enable oauth for us, so we can have an access token and a refresh token.
The response we get, has the following structure:
url: https://mybusiness.googleapis.com/v4/accounts/{account_id}/locations/{location_id}/reviews
{
"reviews": [
{
"reviewId": "some-id,
"reviewer": {
"profilePhotoUrl": "some-url",
"displayName": "Some Sample Name"
},
"starRating": "FOUR",
"comment": "Some long comment left by the user.",
"createTime": "2021-02-15T14:35:19.252Z",
"updateTime": "2021-02-15T14:35:19.252Z",
"reviewReply": {
"comment": "Some long reply by the business.",
"updateTime": "2021-03-04T16:49:32.973Z"
},
"name": "accounts/{account_id}/locations/{location_id}/reviews/{review_id}"
},
...
],
"averageRating": 4.5,
"totalReviewCount": 1312,
"nextPageToken": "some-page-token"
}
The problem is, for some set of clients, we are getting just an empty object (literally, we are receiving {} as the response body). We are not sure why this is happening, since we are able to see reviews on the client's web site, and we are not getting any error. We've refreshed tokens and refreshed tokens without any success.
I've tried posting a support ticket with GCP in order to get some guidance, but it seems that you don't get any help in this kind of issues if you don't have the right support plan.
Anyhow, any help on this issue (why is happening? can it be fixed? is it a setup problem? etc.) is very much appreciated.

Docusign Create Envelope ENVELOPE_IS_INCOMPLETE using templateId

The Envelope is not Complete. A Complete Envelope Requires Documents, Recipients, Tabs, and a Subject Line.
I am trying to create an envelope using the REST Api from docusign and got this error. This was working a few weeks ago and now, I suddenly got this error. Below is my json body for the request.
{
"status": "sent",
"emailSubject": "Company Contract: Signature Required",
"templateId": "310439de-819e-404b-90d6-a468bc0e4e12",
"templateRoles": [
{
"email": "sample1#gmail.com",
"name": "Buyer Buy",
"roleName": "BUYER_PROFILE"
},
{
"email": "sample#gmail.com",
"name": "First Floor",
"roleName": "SELLER_PROFILE"
}
]
}
I also tried this request via postman and I still have the same error. I hope anyone can help. Thanks
It seems you have not added any DS Tabs for all the signers in your DS template "templateId": "310439de-819e-404b-90d6-a468bc0e4e12". A signer in an envelope always needs at least on DS Tab on the document. So update your template to add atleast one tab for every Signer role and it should fix your error.

AWS Pinpoint/Ionic - "Resource not found" error when trying to send push through CLI

I am new at programming with AWS services, so some fundamental things are pretty hard for me. Recently, I was asked to develop an app that used Amazon Pinpoint to send push notifications, as a test for considering future implementations.
As you can see in another question I posted in here (Amazon Pinpoint and Ionic - Push notifications not working when app is in background), I was having trouble trying to send push notifications to users when my app is running in the background. The app was developed using Ionic by following these steps.
When I was almost giving up, I decided to try sending the pushes directly through Firebase, and it finally worked. Some research took me to this question, in which another user described the problem as only happening in AWS Console, so the solution would be to use CLI. After searching a little about it, I found this tutorial about how to sending pinpoint messages to users using CLI, that seems to be what I wanted. Combining it with this documentation about phonegap plugin, I was able to generate a JSON I thought could be a solution:
{
"ApplicationId":"io.ionic.starter",
"MessageRequest":{
"Addresses": {
"": {
"BodyOverride": "",
"ChannelType": "GCM",
"Context": {
"": ""
},
"RawContent": "",
"Substitutions": {},
"TitleOverride": ""
}
},
"Context": {
"": ""
},
"Endpoints": {"us-east-1": {
"BodyOverride": "",
"Context": {},
"RawContent": "",
"Substitutions": {},
"TitleOverride": ""
}
},
"MessageConfiguration": {
"GCMMessage": {
"Action": "OPEN_APP",
"Body": "string",
"CollapseKey": "",
"Data": {
"": ""
},
"IconReference": "",
"ImageIconUrl": "",
"ImageUrl": "",
"Priority": "High",
"RawContent": "{\"data\":{\"title\":\"sometitle\",\"body\":\"somebody\",\"url\":\"insertyourlinkhere.com\"}}",
"RestrictedPackageName": "",
"SilentPush": false,
"SmallImageIconUrl": "",
"Sound": "string",
"Substitutions": {},
"TimeToLive": 123,
"Title": "",
"Url": ""
}
}
}
}
But when I executed it in cmd with aws pinpoint send-messages --color on --region us-east-1 --cli-input-json file://test.json, I got the response An error occurred (NotFoundException) when calling the SendMessages operation: Resource not found.
I believe I didn't write the JSON file correctly, since it's my first time doing this. So please, if any of you know what I am doing wrong, no mattering which step I misunderstood, I would appreciate the help!
"Endpoints" field in the Message request deals with the endpoint id (the identifier associated with an end user device while registering to pinpoint and not the region.)
In case if you haven't registered any endpoints with Pinpoint, you can use the "Addresses" field. After registering the GCM Channel in Amazon Pinpoint, you can get the GCM device token from your device and specify it here.
Here is a sample for sending direct messages using Amazon Pinpoint Note: The example deals with sending SMS message. You should have registered a SMS channel first and created an endpoint with the endpoint id as "test-endpoint1". Otherwise, you can use the "Addresses" field instead of "Endpoints" field.
aws pinpoint send-messages --application-id $APP_ID --message-request '{"MessageConfiguration": {"SMSMessage":{"Body":"hi hello"}},"Endpoints": {"test-endpoint1": {}}}
Also Note: ApplicationId is generated by Pinpoint. When you visit the Pinpoint console and choose your application, the URL will be of the format
https://console.aws.amazon.com/pinpoint/home/?region=us-east-1#/apps/someverybigstringhere/
Here "someverybigstringhere" is the ApplicationId and not the name you give for your project.

Utterances to test lambda function not working (but lambda function itself executes)

I have a lambda function that executes successfully with an intent called GetEvent that returns a specific string. I've created one utterance for this intent for testing purposes (one that is simple and doesn't require any of the optional slots for invoking the skill), but when using the service simulator to test the lambda function with this utterance for GetEvent I'm met with a lambda response that says "The response is invalid". Here is what the interaction model looks like:
#Intent Schema
{
"intents": [
{
"intent": "GetVessel",
"slots": [
{
"name": "boat",
"type": "LIST_OF_VESSELS"
},
{
"name": "location",
"type": "LIST_OF_LOCATIONS"
},
{
"name": "date",
"type": "AMAZON.DATE"
},
{
"name": "event",
"type": "LIST_OF_EVENTS"
}
]
},
{
"intent": "GetLocation",
"slots": [
{
"name": "event",
"type": "LIST_OF_EVENTS"
},
{
"name": "date",
"type": "AMAZON.DATE"
},
{
"name": "boat",
"type": "LIST_OF_VESSELS"
},
{
"name": "location",
"type": "LIST_OF_LOCATIONS"
}
]
},
{
"intent": "GetEvent",
"slots": [
{
"name": "event",
"type": "LIST_OF_EVENTS"
},
{
"name": "location",
"type": "LIST_OF_LOCATIONS"
}
]
}
]
}
With the appropriate custom skill type syntax and,
#First test Utterances
GetVessel what are the properties of {boat}
GetLocation where did {event} occur
GetEvent get me my query
When giving Alexa the utterance get me my query the lambda response should output the string as it did in the execution. I'm not sure why this isn't the case; this is my first project with the Alexa Skills Kit, so I am pretty new. Is there something I'm not understanding with how the lambda function, the intent schema and the utterances are all pieced together?
UPDATE: Thanks to some help from AWSSupport, I've narrowed the issue down to the area in the json request where new session is flagged as true. For the utterance to work this must be set to false (this works when inputting the json request manually, and this is also the case during the lambda execution). Why is this the case? Does Alexa really care about whether or not it is a new session during invocation? I've cross-posted this to the Amazon Developer Forums as well a couple of days ago, but have yet to get a response from someone.
This may or may not have changed -- the last time I used the service simulator (about two weeks ago at the time of writing) it had a pretty severe bug which would lead to requests being mapped to your first / wrong intent, regardless of actual simulated speech input.
So even if you typed in something random like wafaaefgae it simply tries to map that to the first intent you have defined, providing no slots to said intent which may lead to unexpected results.
Your issue could very well be related to this, triggering the same unexpected / buggy behavior because you aren't using any slots in your sample utterance
Before spending more time debugging this, I'd recommend trying the Intent using an actual echo or alternatively https://echosim.io/ -- interaction via actual speech works as expected, unlike the 'simulator'

How to handle different data type for same property for a HTTP or REST API

I work on a web application using AngularJS for the frontend and the backend for Symfony2. I want to make a web service so I can have a one page app. I am wondering about how I should handle the data exchange between the two layers.
Consider this use case:
A user wants to create a project in the application and must specify whether it be as a customer or supplier in that project. The creator of the project gives the project a name and a description. Then he enters the email address of the contact person (who will be the customer or supplier in the project depending on the choice of the user who created the project). When creating the project the system checks whether the contact person is already registered otherwise it sends an invitation to join the application and waits. It is not necessary to invite the contact person at the creation of a project that can be done later.
I imagine the API is as follows:
POST http://app.com/api/projects
Request:
{
"name": "My Project"
"descrption": "My Project'description"
"vendor": {
"user_id": 3245
}
"client": "myclient#email.com"
}
Response:
{
"name": "My Project"
"description": "My Project'description"
"vendor": {
"user_id": 3245,
"name": "John Doe"
}
"client": {
"user_id": 2754,
"name": "Peter Doe"
}
"creator": {
"user_id": 3245,
"name": "John Doe"
}
}
So we can see that the type of data exchanged in the creation of a project differs.
Can I link directly to my model application (after validation of course)?
How should I go about updating a project?
Is it better to create Transfer Objects and managed into my business logic and a TransfertObject for input and one for output?