I am having a very weird issue, I have a Chat Bot which is surfaced using a HTML page using DirectLine. But now whenever I post a message with DOUBLE QUOTES in it, it just gives me a 502 Bad Gateway error.
JS CODE:
BotChat.App({
bot: bot,
locale: params['locale'],
resize: 'detect',
speechOptions: speechOptions,
user: user,
botConnection: botConnection
}, document.getElementById('BotChatGoesHere'));
Chat Message:
Developer Console Error:
DEVELOPER CONSOLE NETWORK LOG:
I have been working with Bot Framework for quite sometime now, but this is the first time I am facing something like this.
Regards,
Hari
This has come up recently and is specific to the webchat and Directline channels. According to this bug on Github,
The smart quotes conversion are done by Markdown-It.
https://github.com/markdown-it/markdown-it#init-with-presets-and-options
By default, all message without textFormat will assume to be
"markdown". If you send activity of
{ type: 'message', textFormat: 'plain', text: '"What\'s up?"' }
the message will be plain text and not go thru Markdown-It. Quotes will not turn into smart quotes.
Related
Here's my scenario - a user enters his phone number and the number of the person he wants to call.
Via c# Twilio calls the user number then connects to the person he wants to call. I then record the conversation.
I can get it all working and recording for a single phone number.
However, when trying to connect to a second number (the first number does ring, but I get the standard Twilio "application error"), I get the following 502 error:
Twilio was unable to fetch content from: https://xxx.xxx.net/Call/Connect?recipientNumber={number}
Error: Error reading response: Response does not contain content type
Account SID: xxxxxxxxxxxxxxxxxxxxxxxx
SID: xxxxxxxxxxxxxxxxxxxxxx
Request ID: xxxxxxxxxxxxxxxxxxxxx
Remote Host: xxx.xxx.net
Request Method: POST
Request URI: https://xxx.xxx.net/Call/Connect?recipientNumber={number}
SSL Version: TLSv1.2
This stems from basic code:
var response = new VoiceResponse();
response.Say("We are about to connect you.").Dial(recipientNumber).Hangup();
return TwiML(response);
Can anyone advise on where I'm going wrong or what I'm missing?
Turns out it was a conflict of versioning and/or DLL's - removed nuget Twilio package and manually added Twilio DLL's. Problem solved!!!
I recently upgraded the Twilio C# DLL we've been using to handle SMS messages. We are now on Twilio.DLL v5.16.2. I have a webhook set up to call a custom URL on our website. That part is working, because I can log the Request coming in (message SID and body and all that good stuff). At the end, we have code to instantiate a MessagingResponse object to send back a confirmation that the message was received. That's not working anymore. I don't get a SMS message on my phone nor do I see an Outgoing API record on the SMS logs page when I'm logged into my project on Twilio.com (whereas I do see the test message I've sent to our number as an Incoming message).
There is no error or exception either.
Any idea how to debug/solve this?
string responseTxt = "TESTING: Got it. Thanks.";
var smsResponse = new MessagingResponse();
var smsMsg = smsResponse.Message(responseTxt);
response.Write(smsMsg);
Twilio developer evangelist here.
I'm not a C# developer, so forgive me if I'm wrong. Also, I don't know what happened with this change.
Anyway, from what I can see, the message body when using the MessagingResponse's Message method appears to be a named argument now. Changing your code to the following should work for the latest version of the DLL.
var smsMsg = smsResponse.Message(body: responseTxt);
Let me know if that helps.
I'm not sure there's much to update as the exact same scenario still stands. But I can reiterate to see if this provides any additional clues.
We have a Twilio SMS service set up. There is a webhook assigned to our number that maps to an HTTP Handler on an ASP.NET website. The code in the handler logs in our database the fact that an SMS message was received and various bits of info (from the Request.Form variables supplied by Twilio, From number, body of the message, num of media, etc.).
Then, the code "replies" to the original SMS sender using the MessagingResponse object. See original code snippet. Really couldn't be much simpler.
Note, this is and has all been working quite well, using the Twilio c# helper library 5.6.
I upgraded the Twilio library to the latest rev (5.25.1) and its dependencies. Copied the new DLLs to our dev webserver. Now the reply message, using the MessagingResponse object, never occurs. The webhook is still called as I can see the new record in the database logging the message details. Just no response. No error, no exception. Just nothing.
If I rollback to our old version of the Twilio library (and its dependencies, thank goodness for Git!), it works again.
I have this error message anytime I try to connect to my bot via directline:
There was an error sending this message to your bot: HTTP status code GatewayTimeout
I didn't have this error at first, it just appeared recently and I dont know what to do, please help. My AppID and Passwords are set correctly.
I wanted to fetch the messages that was sent to the other connected linkedin users.
I found a code sample to send the message in this site
https://developer.linkedin.com/documents/sample-code-sending-message
But, I did not any sample to fetch the messages.
However, when I tried to fetch the message with the query "/people/~/mailbox", I got the error
"The remote server returned an error: (403) Forbidden."
In detail error message, I got "Access to mailbox denied".
These 2 documentations has listed only the Primary Endpoints "POST /people/~/mailbox" but has not mentioned about GET.
https://developer.linkedin.com/oauth-10a-overview
https://developer.linkedin.com/documents/authentication#oauth2-redirect-uri
Is there any way to fetch the message? Or Is there any workaround?
Any insights or help will be highly appreciated.
Thanks
I don't think Linkedin Inbox is supported any longer through their API. As per this answer on quora,
API is not publicly available but has been made available to several
partners. The best thing to do is contact LinkedIn's BD team for
access.
I was not able to see any specific mention to this type of access in their documentation.
Furthermore, check out APIGEE Snapshot for LinkedIn's 3 main API categories
I am getting this error:
Client found response content type of 'text/html', but expected 'text/xml.
I am adding web reference for live search. When i build the project its Successful. But after that once i enter some text in textbox & enter search button it gives this error. I am Using my local machine & Using .net 2.0 with C#.
Plz help me...
Thanks In Advance...
As Matt said, it's probably an error page coming back.
Either use a proxy like Fiddler or a network sniffer like WireShark to see what the raw response is - that should help you get to the bottom of what's going on.
Generally that error means that the service has sent back an (HTML) error message rather than the XML SOAP response that your client was expecting.
For web services that you control it's really easy to find the problem, because you can invoke the webmethods by hand in your browser. To diagnose it when it's someone else's service is a little trickier. You might be able to trace into the code for your web reference and inspect the text of the response before the exception is thrown.
I have found Fiddler to be highly useful in debugging http client server issues.
It is a proxy that allows you to intercept and even change the content of the request and response.
In your actual code, replace the line:
searchRequest.AppID = "APP ID you generated from ...";
with the actual AppID, which should be a long alpha-numeric sequence.