ServiceError with basic Direct Line interaction - botframework

I've got a basic bot that I am trying to interact with via Direct Line. Following this example, these are what my requests look like:
Start Conversation
Send Activity
The error it responds with is difficult to investigate with such minimal information. The bot itself is working perfectly on other channels.
Has anyone seen this before?

Apologies for answering my own question. It turns out, the Send Activity request was sent as application/text instead of application/json.
I wish the error was more clear on why it was rejecting it but that fixed my issue.

Related

Microsoft Teams bots can only update the last two posts in a conversation. Is that by design?

Summary
I am using the Bot Framework REST API to create and update Microsoft Teams posts.
I have found that I can only update the last two posts of a conversation, but cannot find documentation that describes this restriction.
It is not possible to identify the failed updates from the API response, as the HTTP response code and body is always the same, regardless of whether the update works or not (200 with the id of the "updated" activity). I would expect the response to indicate the failure, and so this appears to be a Teams bug.
Detail
I can create conversations and create replies to conversations using the Bot Framework REST API without issue (using the create conversation and send to conversation endpoints). My problem arises if I try to update these messages.
Given a conversation that looks like this:
parent_message
|_ child_message_1
|_ child_message_2
|_ child_message_3
If I attempt to use the update activty endpoint to update each one of these messages, I observe that:
I can always update parent_message.
I can update child_message_3 and child_message_2, but not child_message_1. In each case the HTTP response is a successful HTTP response (200 response code, with a JSON body that contains the id of the updated message), regardless of whether the update succeeds or not.
If I add another message, child_message_4, then this will be updatable, but child_message_2 will no longer be updatable. I assume this is because now child_message_2 is no longer one of the last two messages.
I see the same behavior if another user adds messages to the conversation, ie. if a user were to make two posts to the conversation I would no longer be able to update any of my own child messages as they are no longer one of the last two messages.
My questions are:
Does anyone know if this restriction is by design? If so, can you point to some documentation on this?
Is it possible to determine when an update fails? As mentioned, the HTTP response always reports success so I'm unable to find a way to do this. Is this a bug in Teams?
Thanks for reporting this. We are able to repro this at our end and we are tracking it here: MicrosoftDocs/msteams-docs#2011
Please follow this issue for updates/progress/questions.
Updates: This is fixed.
This appears to be a bug, but I think the bug is different from what you think it is. Go ahead and "refresh" the conversation and you should see the updates in effect. If you're using the web app then you can refresh the page, but since you're probably using the desktop or mobile app then you could try switching to another conversation and back, or you might have to sign out and sign in again.

user receiving same message twice from Skype bot

I was trying to send skype-bot message to skype-user using REST API in nodeJs, but user receives bot-message two times of that single message. I am sending the message with HTTP POST request only single time using a single activityId. Is there any way to control duplicate messages? what can be the reason behind this?
I have gone through this Receiving the same message twice
Can anyone please like to help finding the issue?
[No sdk or other library is used ]
I have found the issue. I was subscribing redis to read message and deliver to user. I found that it was happening twice[one in my app uploaded to server and another in my local machine]. Now resolves. Thanks !

Replying to certain message in Twilio

I am making an event organisation platform. Whenever user creates an event, the candidate gets an email notification as well as sms notification asking whether the suggested time fits or not. The problem is that since it is event organisation, there may be more than one occurance of candidate's mobile phone. So I need to have some unique information to identify to which event candidate is responding to.
I have tried identify using Message SID, but then I realised that Message SID is different on reply message.
So my question would be: is there any way to authenticate to which message candidate is replying to?
Hi Twilio developer evangelist here.
Because every message is idempotent, you wouldn't be able to track them just via the call sid. however, there's way to get around that such as passing a code that goes with each message which you can then read, or using cookies.
I think you are probably going to be more successful using cookies, and luckily enough there is an article on twilio's website that describes just how to do that. And because I noticed you're using PHP, I'm pointing you directly to the PHP article on tracking SMS conversations.
Hope this helps you

Debugging Google cloud messaging push messages

I am trying to send push messages to an android application.
The POST https://android.googleapis.com/gcm/send
seems to succeed and I get something (with some numbers changed) like:
{"multicast_id":9999063399994069899,
"success":1,
"failure":0,
"canonical_ids":0,
"results":[{"message_id":"0:1416520599679103%8d7d198de508343a"}]}
but I don't seem to get the notification on the device...
Is there anything that can be done with the message_id it track it forward ?
Can I somehow tell me if Google actually tired to deliver it to the device and what was the result of the attempt?
I know it's an old question and you might have solved it yourself by now, but for completeness I would like to post a solution here.
By now you can find the option GCM Diagnostics in your Google Play Developer Console when you have your app selected. It's placed on the left hand side.
You just post a registration token or a message id and will shortly see a summary of push notifications connected to this token/id, plus additional debug information.
Cheers!
well, at least until someone would provide a better answer about debugging based on message ids.
It turns out the problem in my case was that the phone gap plugin in I was using was expecting a "message" field in the push notification message payload.
A bug on my server side made this message not to exist so it was not displayed in the phones notification area...
my thanks to #Eran for partially pushing my towards the right line of thought.

Sending and SMS from your computer

There is a ton of data on this subject where you simply take the phone-number+#mobile-carrier.com and send a message, that is not what I am looking to do.
I want to send an SMS, from the command line, in this case, using php, but I would be happy to use bash, and will probably make it into an app or plug in for Safari eventually. Right now, a test case would suit me fine.
I would like to do something like this:
./sms 619-555-1212 "this is the message"
I don't need to receive the message back to the computer, this is a sending only agent.
The criteria that makes all the data I find on this not work, is that I want my correct from: number to show up. I have tried using the email gateway method and changing he from: headers, but it appears they are stripped at the gateway.
I don't mind paying a service to give me certain amount of SMS credits to make this happen. I want to avoid any hardware, where I would have to get a modem or otherwise to connect to my computer.
If I do use a service, something with an example of how to do so within their API would greatly appreciated. I feel this should take me no more than 15 minutes, but I am hours into research and not getting very far with all the little scripts out there that do nothing close to what I want to do.
Thank you very much and sorry that I don't understand this protocol to the best of my ability.
You can send with Twilio using cURL very easily since sending SMS is a simple POST request with three parameters. Here's an example of a bash script that makes calls but could be modified to use the SMS API instead. http://labs.twilio.com/bash/
(I work at Twilio)
you will need sms gateway like http://www.clickatell.com/ for that
You can use any gateway that charges you a few cents for every message sent. They have a simple REST API which requires a very little coding. They even provide you a sample example to get started.

Resources