Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Unanswered

Testing a business event with an HTTPS endpoint

(1) ShareShare
ReportReport
Posted on by 240
I am creating a business event which is sent to an HTTPS endpoint (webApi in azure)
 
When I create the endpoint in D365 after publishing my WebApi using the following function signature, the D365 endpoint creation works succesfully:
 
app.MapPost(//myendpoint/, () =>
{
    app.Logger.LogInformation($/MessageReceived!/);
    return Results.Ok();
});
 
However, I want to add validation and a payload to my endpoint, like so:
 
app.MapPost(//myendpoint/, async (IValidator<CustomerFilesBusinessEvent> validator, MyDataClass data)
 
Now when I locally run my WebApi project I can perfectly POST make succesful calls to the endpoint using Postman, so the payload I send there is correct.
However, after publishing this revision of my WebApi, editing the business event endpoint in D365 does not work and it returns a 400 Bad request.
I figure that this is logical, because the D365 could never know what payload the HTTPS endpoint of the webApi would expect.
So I figured I can now only test my business event by sending an actual business event with the correct payload.
(since the endpoint had already been created when the function was still published WITHOUT payload)
 
So I sent a business event via D365, but it runs into error, saying:
The webhook call failed because the http request received non-success httpStatus code. Please check your webhook request handler.
 
So now I have 2 questions:
-1. Is my assumption correct that you could never test an HTTPS endpoint via D365 that contains payload, since D365 could never know what payload to send along in it's test?
-2. How can I find out why the business event runs into error? I am sending the exact same data along as payload as I sent via postman
  • Anthony Blake Profile Picture
    2,339 Super User 2025 Season 1 on at
    Testing a business event with an HTTPS endpoint
    Great question. If this were going to a Webhook in Azure such as a Logic app/Function/APIM instance, I would be checking the logs there to see what was sent to produce the Bad Request error. Does your WebAPI have any logs or logging functionality? Maybe set it up to send to a simple Azure endpoint to make use of the logging?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 293,112 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,893 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans