This is for those who have tried using Mandrill .NET in github.
I need to be able to process inbound mails, and based on Mandrill documentation, I have to create a webhook with a corresponding public url. In terms of implementing the action method, I followed the method signature as described in the documentation of WebHookEvent.cs. At that point everything was working as expected: if I send mail to the mandrill email which I registered to the webhook event, the action method is invoked from Mandrill. For discussions's sake let's assume that the method name is ProcessInboundMail.
Moving forward, my app needs to support multitenancy. So instead of a straightforward processing in the method ProcessInboundMail, I have to somehow Redirect to a url that includes the appropriate subdomain (e.g. company1.myapp.com/mycontroller/ProcessInboundMail). From then on I started to encounter a peculiar issue.
If I send mail to the mandrill email, the action method is no longer properly executed. To verify if the webhook is working, I went to the mandrill admin page > Inbound > Domains (InboundDomains.png), clicked Routes button, then clicked the button "send test" (MailboxRoutes.png), but all I get is this error message:
Webhook failed with error: POST to http://myapp.com/mycontroller/ProcessInboundMail failed with 411: Length Required
Length Required
HTTP Error 411. The request must be chunked or have a content length.
Here is how my ProcessInboundMail looks like:
[AllowAnonymous]
[ValidateInput(false)] // May be required if accepting inbound webhooks
[AcceptVerbs(HttpVerbs.Get | HttpVerbs.Post | HttpVerbs.Head)]
public ActionResult ProcessInboundMail(string id, FormCollection val)
{
var events = Mandrill.JSON.Parse<List<Mandrill.WebHookEvent>>(val.Get("mandrill_events"));
foreach (var e in events)
{
//logic here...
var redirectResult = Redirect(toSomeUrl);
redirectResult.ExecuteResult(this.ControllerContext);
}
return Json(1, JsonRequestBehavior.AllowGet);
}
My question is, how come when I was not using Redirect, clicking "send test" was successful, but now that I am using Redirect, I'm getting this HTTP error 411 when clicking "send test"? What am I doing wrong here?
Related
I try to receive signed file from Docusing using web hook listener, before it working file , but form 31-05-2022 Docusing cant call our web hook listener.
When i check log from Connect menu, i got this error on bottom
6/22/2022 | 3:52:07 pm
Error: Exception in EnvelopeIntegration.RunIntegration: ac08432f-18c4-471d-8720-caaf78fe4dfc :: No URI :: Error - Invalid URI: The URI is empty.;
This is the code i pass web hook listener url.
Dim eventNotification = New EventNotification()
eveventNotification.Url ="https://www.sample.com/webhook/default.aspx"
eventNotification.RequireAcknowledgment = "true"
eventNotification.IncludeDocuments = "true"
eventNotification.LoggingEnabled = "true"
May i know exact problem ? This final success receive from web listener is 5/30/2022, after that all are failure.
Thanks and Regards
Aravind
This error typically means you're using envelope-level EventNotifications, but you're not actually defining a valid url parameter when you're sending an envelope.
You'll want to check your Envelope Definition in your code, but you can also use API Request Logging to capture what your application is sending to DocuSign
I have the following case:
I use the Outlook REST API (without any library) to visualize the users' emails - including Event invites. First, I make a call to get only the message properties and if the message has MeetingMessageType value, then another request is sent to:
https://outlook.office.com/api/v2.0/me/messages/<messageId>?$select=Microsoft.OutlookServices.EventMessage/MeetingMessageType&$expand=Microsoft.OutlookServices.EventMessage/event($select=Id,SeriesMasterId,iCalUID,Type,CreatedDateTime,LastModifiedDateTime,WebLink,Calendar,Start,End,IsAllDay,IsCancelled,Organizer,Attendees,Location,Subject,ResponseStatus,OnlineMeetingUrl,Recurrence,ResponseRequested)
to get the Event information and provide the customer with the option to respond to the invite.
The problem:
Since yesterday one of our clients reported that he can't see the event information. It turns out that the request for getting this information is returning 404.
The response body:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store., The process failed to get the correct properties."
}
}
The event is shown in the Outlook desktop mail client.
The client also shared that they have enabled ATP (advance threat protection) at his company. Not sure if this can have anything to do with the problem.
I see that other clients also have this problem.
Update:
I asked the user to try the following requests from the Outlook sandbox:
https://outlook.office.com/api/v2.0/me/messages/<messageId>
This request returns the EventMessage with "MeetingMessageType": "MeetingRequest".
Then when he tried accessing the Event:
https://outlook.office.com/api/v2.0/me/messages/<messageId>?$select=Microsoft.OutlookServices.EventMessage%2FMeetingMessageType&$expand=Microsoft.OutlookServices.EventMessage%2Fevent
The Outlook REST API returns 404.
For me, the same formatted requests work, so I can't really understand what is going on.
Please, any information will be well appreciated!
I have a Web App Bot running on Azure.
It's using the Microsoft Bot Framework Direct Line API 3.0.
I want to use the URL Ping Test type instead of the Multi-Stage Web Test for the Availability Test of the Bot because I do not have the Visual Studio 2017 Enterprise edition.
In the Bot's message controller, this is how I handle the response for Pings.
I am able to get expected response in the Bot emulator when running the Bot in localhost.
else if (message.Type == ActivityTypes.Ping)
{
ConnectorClient client = new ConnectorClient(new Uri(message.ServiceUrl));
var reply = message.CreateReply();
reply.Text = "{Some message}";
await client.Conversations.ReplyToActivityAsync(reply);
}
However, when I connect to the Bot in Azure, I am getting HTTP error 500.
I'm not sure what is the root cause and wonder whether it is due to the URL Ping Test does not know the Direct Line secret.
Appreciate your kind help on this.
Thanks very much.
If you check the “Send an activity to the bot” in Direct Line API 3.0 documentation, you can find:
To send an activity to the bot, the client must create an Activity object to define the activity and then issue a POST request, specifying the Activity object in the body of the request.
URL ping test would sned a GET request to the URL that you specified, it would not hit/trigger the code that you defined for Ping activity in your MessagesController.
If you’d like to detect whether your bot is alive by sending a Ping activity, you could make a request like below from your client.
Request:
POST https://directline.botframework.com/v3/directline/conversations/{conversationId}/activities
Authorization: Bearer {directline_secret}
Content-Type: application/json
Body:
{
"type": "ping",
"from": {
"id": "user1"
}
}
We are receiving the following error when I try to create a recipient view. Basically the document is sent to 2 users, one of them has already signed but the other user can not sign because there’s no URL created and sent to us from Docusign. We are using node.js docusign sdk.
var recipientView = new docusign.RecipientViewRequest();
recipientView.setReturnUrl();
recipientView.setUserName();
recipientView.setEmail(;
recipientView.setAuthenticationMethod("email");
recipientView.setClientUserId();
var envelopesApi = new docusign.EnvelopesApi();
envelopesApi.createRecipientView(accountId, envelope.id, recipientView,
function(error, viewUrl, response) {
// no url is returned here.the error (in the image) is shown
});
I printed the values of accountId, envelopeId and those seemed to be fine.I checked if the user had changed his first name, last name and there were no errors there. If I create a new user from scratch everything works fine.
FrontEnd Error
Response Error
Through your screenshots it looks like you are getting an UKNOWN_ENVELOPE_RECIPIENT error returned from the API. This means the recipient data you are sending to identify the recipient is not correct. It needs to exactly match the data you assigned to the recipient when you added them to the envelope, such as name, email, recipientId, and clientUserId.
Try calling the EnvelopeRecipients: List API before you make the request to generate the URL and ensure that the recipient data matches what you are sending in your createRecipientView() request. That should help identify which piece of data is off, once you correct that the call will then start returning the proper URL.
Also see the Embedded Signing features page in the DocuSign Developer Center which shows exactly which params you need to set etc:
I noticed the Direct Line request url is like this: https://localhost:8011/api/ in the documention. What should replace it with?
I have deployed a todoBot example project from botbuilder Examples folder. And I have created a bot in My bots section, the ending point is: http://www.bigluntan.com:3978/api/messages. I have tested in Test connection to your bot section, it is working when I type something and send it. Right now, I want to give Direct Line a try. So I added Direct Line to Channels. But the most confused part is, how do I call this Direct Line api, cause the ending point is different than my bot's ending point.
The base URL is https://directline.botframework.com, so for instance, the POST request to get a new conversationId should be https://directline.botframework.com/api/conversations/
The request headers should include the Content-Type and also the following:
Authorization: BotConnector < Your secret >
where your secret is the code which was created when you created a Direct Line channel for your registered Bot (see image below). e.g.
Content-Type: application/json; charset=utf-8
Authorization: BotConnector pB7INWcXQjA.cwA.RF4.cglOUNHUOzWVv0Rlk3ovFNhtp1JPz1Zx9jmu8vX7zXs
Once you get a conversationId, you can POST a message using the URL https://directline.botframework.com/api/conversations/< conversationId >/messages
The body of the request should include the message text. You will not get the reply in the POST response. Instead, you need to get it by sending a GET to
https://directline.botframework.com/api/conversations/< conversationId >/messages. From there, you can get the "from" value in your first message, and use it in subsequent calls to the same conversation (otherwise the bot will not recognise the state, and just keep repeating the first reply message), e.g.
{
text: "yes",
from: "EQxvIzZOspA"
}
I found this out by trial and error. If you want to use the direct line api you should try https://directline.botframework.com
as the base URL