Get Customer Input block throws error when using Lex as customer input - amazon-lex

I am trying to configure lex bot in AWS Connect. I have created a demo Lex bot that is working fine in Lex but after integrating it with Aws Connect in the Get Customer Input block in the contact flow, it throws an error.
I have checked the error in CloudWatch and you can see the error following:
{
"Results": "Error",
"ContactId": "contactId",
"ContactFlowId": "COntactFlowId",
"ContactFlowName": "TalkToOctaveAgent2",
"ContactFlowModuleType": "GetUserInput",
"Timestamp": "2022-03-25T05:30:08.252Z"
}
I can't recognize where this error comes from. I have set lex intents in the Get Customer Input block with proper names as in Lex. Please let me know how I can resolve this error.

Related

Microsoft Graph returning Resource Not Found

I've registered an app in Azure AD and given it API permissions(both Application and delegated) to read all AD groups (Group.Read.All, also Directory.Read.All etc). Using this app I am using Graph Service Client to make a call to get user's AD groups.
public async Task<IEnumerable<GroupInfo>> GetAllGroupsOfUser(string mail)
{
IList<GroupInfo> result = new List<GroupInfo>();
IUserMemberOfCollectionWithReferencesPage memberOfGroups = await _graphServiceClient.Users[mail].MemberOf.Request().GetAsync();
.......... More code ........
}
It works fine for most of the users email but for few emails, which are present in the active directory, I'm getting the following exception
Code: Request_ResourceNotFound Message: Resource 'someuser#somedomain.co' does not exist or one of its queried reference-property objects are not present.
Your error is not that you lack certain permissions, and it has nothing to do with which api testing tool you are using. Your error is very simple. As your error message says, it is that you entered the wrong user email.
Your error message has clearly stated that there is no'someuser#somedomain.co' email, because this is not a correct email, it should be .com instead of .co.
So you must make sure that you enter the correct email without special characters or spaces.
This is my test result:
1.
2.

Serverless Phone Verification with Twilio Verify and Twilio Functions

I am trying to implement the project from https://www.twilio.com/blog/serverless-phone-verification to verify phone number using SMS TOTP.
When I created new function the url given by Twilio Functions is https://isabelline-badger-5492.twil.io/sendTOTP
I have given the VERIFY_SERVICE_SID env variable to point to correct value ‘VAxxxxxxx’.
But I am getting error as below. Please advise what is wrong.
The Verify functions works fine by itself, but when triggered from Functions, it throws below error.
{
"success": false,
"message": {
"status": 404,
"message": "The requested resource /Services/VAxxxxxxx/Verifications was not found",
"code": 20404,
"moreInfo": "https://www.twilio.com/docs/errors/20404"
}
}
Make sure the Twilio helper library your Twilio Functions are using is up to date (3.29.2 is to old to use this newer feature). If using the Console based functions, you can find and set the version here, for twilio. Make sure to click save. The latest helper library version as of this response is 3.37.1. This will fix the issue.

Error when trying to join a channel via API

im using slack to make chat bot so i can create a message center from my ios app to send message from ios app to slack.
getting following response from hitting joinChannel api https://slack.com/api/channels.join
cant get channel ids
{
"provided" : "admin,identify,chat:write:bot",
"ok" : false,
"needed" : "channels:write",
"error" : "missing_scope"
}
As the error message says you need the channels.write scope to use channels.join method.
Just add the missing scope to your access token and it will work.

How do I get twilio 5 digit error code for a failed voice call?

We have a callback url in place that is correctly capturing the failed status of a call.
Our code then fetches from twilio the details of the call by doing the following:
$call = $twilio_client->calls($sid)->fetch();
Within the call details returned there is no 5 digit error code listed, even though the failed status is present.
How do we get the 5 digit error code that caused the failure?
Twilio developer evangelist here.
Thanks to #miknik for the answer, however that is actually a deprecated resource (which is why you can't currently find any documentation on the matter). It's taken me a while to find the answer as I've been chasing down where the notifications have gone.
The Notifications API was deprecated in favour of the Monitor Alerts API. This API can give you all the details about an alert, including the 5 digit code.
The best way to receive these alerts for your application is to set up a webhook in your account console which will send all the parameters about the alert as part of the request.
You can also list your alerts which will allow you to find alerts from a specific resource SID (in your case, a call SID).
Let me know if this helps at all.
Make an authenticated GET request to
/2010-04-01/Accounts/{AccountNumber}/Calls/{CallSid}/Notifications
So in PHP the following will retrieve the notification info for your call
$json = file_get_contents('https://{AccountNumber}:{AuthToken}#api.twilio.com/2010-04-01/Accounts/{AccountNumber}/Calls/{CallSid}/Notifications.json');
Then use this line to get the returned JSON into an associative array
$obj = json_decode($json, true);
Now if all you want is the error code its stored as the following variable
echo $obj[notifications][0][error_code];
However, the full error info is also returned as a URL encoded string. You can access this by first urldecoding it, and then parsing the query string into an array with the following line
parse_str(urldecode($obj[notifications][0][message_text]), $output);
And you can now access the variables within like this
echo $output[Msg]; // Error text for failure eg invalid phone number
echo $output[phonenumber]; // Phone number for failed call
echo $output[ErrorCode]; // 5 digit error code
echo $output[LogLevel];` // Log level of error eg WARN
As far as I know this is not implemented in the PHP helper library, so you have to code for it manually

StatusCallback does not work as expected

Overview:
I am working on a VB.NET application that places a call into Twilio, the number is not a test number. I am using the C# library with the code written in VB.Net.
When I use this line of code:
Console.WriteLine(account.SendSmsMessage(Caller, to1, strBody))
I receive a text message on my phone however the post back is never posted to my website. I have included the URL of the site on the account under Messaging > Request URL.
When I reply to the message, Twilio does make a post to my site. From what I understand, a POST should have been made when Twilio was first sent a message from my application, however this is not the case.
When using this code, I do not get any text message and no POST is made.
Console.WriteLine(account.SendMessage(Caller, to1, strBody, PostBackURL))
I have tried SendSMSMessage, I have tried it with the URL on my account and without it,
nothing seems to effect the behavior.
I need the SmsMessageSid at the time the message is sent. From everything I have seen, Twilio does not provide a response other then what is sent to the PostBackURL, I could parse a response for the
SmsMessageSid however since there is no response that is not an option. If I am mistaken on that point that would be great, however it looks like the only way to get a reply is with the post back URL. Thanks for your help with this! Below you will find an excerpt of the code I am working with:
PostBackURL = "http%3A%2F%2F173.111.111.110%3A8001/XMLResponse.aspx"
' Create Twilio REST account object using Twilio account ID and token
account = New Twilio.TwilioRestClient(SID, Token)
message = New Twilio.Message
Try
'WORKS
'Console.WriteLine(account.SendSmsMessage(Caller, to1, strBody))
'DOES NOT WORK
Console.WriteLine(account.SendMessage(Caller, to1, strBody, PostBackURL))
Catch e As Exception
Console.WriteLine("An error occurred: {0}", e.Message)
End Try
Console.WriteLine("Press any key to continue")
Console.ReadKey()
I'm doing something similar with C# and like you, I'm not getting the POST to the callback URL. I don't know why that's not working, but if all you need is the sid when you send the message, you should be able to do this:
message = SendSmsMessage(Caller, to1, strBody))
and message.Sid will give you what you need, assuming no exceptions.

Resources