Why is the hook-response data "undefined"?

Hello,

I’m trying to send something to a web service, and in looking at the logs, my data has a valid number, and the response indicates that the service received the data and echoed it back (which is good); but in between, the hook-sent says that the data is “undefined”. I’ve noticed this also in the documentation example.

Can someone please explain to me why that is happening?

Thanks for any info,

Michael

It’s best to not think of undefined as an error. It means that no data has been defined. The hook-sent event is not intended to have any data, so not having any data defined is not an error. It just has no data and that’s how it works.

1 Like

there is no data in a “hook-sent” event, so it shows as undefined.

That is a “particle-internal” event… an ack that the hook was sent to your desired server.

1 Like

Thanks for the explanation, r7 and BL. If the data doesn’t have a value, however, then why is it included? Is there a standard for webhooks that mandates this, or is it for future expansion, or something else?

@mprogers, if you subscribe to the hook-sent event, it is a simple way to verify that the webhook actually fired. There are many of these types of events which can be used by the device or by a server. :wink:

2 Likes

For compatibility reason. It’s easier not to remove stuff from the public interface that someone might depend on.

3 Likes

That makes perfect sense, and thanks, everyone, for your helpful replies.