Maker API Server not receiving POST events

I've configured Maker API with the following post URL:

http : / / 192.168.x.x:yyyy/api/hub/event (spaces because I'm not allowed to include links)

I can do this successfully both in the Maker API app interface, as well as using the get endpoint with url encoding. I have a ASP dotnet server with this endpoint available, which I can call via post man.

[AllowAnonymous]
[Route("event")]
[HttpPost]
public async Task<ActionResult<EventResponse>> PostEvent([FromBody] HubEventModel request)
{
    return Ok();
}

This endpoint receives an object HubEventModel which should map to all the properties of the posted json object.

public class HubEventModel
{
    public string Name { get; set; }
    public string Value { get; set; }
    public string DisplayName {  get; set; }
    public string DeviceId { get; set; }
    public string DescriptionText { get; set; }
    public string Unit { get; set; }
    public string Data { get; set; }

}

However, this api is never triggered (or possibly even called) by Maker API

When going to the device in hubitat interface it shows the event's triggered apps column that Maker API's eventHandler was triggered. With enabled logging for debugging enabled I see the device event log in Maker API's logs. However, I don't see any evidence that Maker API is sending out the post request, and my server certainly does not receive it. My network has no rules that would block this port and the server is certainly accessible through the port it is running on from any device on my network (it's not running on 80/443 because this is currently in debug mode through vs)

Are there any logs I can use to determine the source of the problem further? Has anyone ran into this issue before? Even if my app wasn't receiving the post because the body was incorrect I would see a failed request by the server (which I do not).

Thanks,

have you run TCPDUMP on your ASP dotnet server ?

Is that how you know its not receiving it?

Running in debug mode the ide will automatically display above the endpoint how many times it was called (either success or fail). So I know that the server is not replying with some automatic error code not delivered by my code. I also know that the endpoint is not executing because I have a breakpoint there which never triggers.
I will look into TCPDUMP and see if I get more information.

I just ran wireshark filtering for source and destination and found that the Maker API IS calling the api. I will report back here when I find out why I'm not receiving it.

So my server WAS receiving the requests the entire time. For whatever reason the IDE did not show the 400 Bad Requests. After tweaking my wireshark filters I was able to see the responses as well.

The Unit and Data properties from Maker API were null. My types for everything was non-optional string. So this caused the bad request. Making all strings optional was necessary. Also, my object structure was wrong as the request has only 1 property "content" which is an object containing all the other properties.

My final model was as follows:

public class HubEventModel
{
    public string? Name { get; set; }
    public string? Value { get; set; }
    public string? DisplayName {  get; set; }
    public string? DeviceId { get; set; }
    public string? DescriptionText { get; set; }
    public string? Unit { get; set; }
    public string? Data { get; set; }

}

public class HubEventDTO
{
    public HubEventModel Content { get; set; }
}

Where HubEventDTO was the body parameter in the request.

Thanks @csteele for suggesting the TCPDUMP

3 Likes