Return of Webhook values

JSO
Silver 2
Silver 2

I've created a POST endpoint on a local server in node.js using express.js and localtunnel.js.
I call this endpoint from AppSheet using a WebHook.
Everything works fine except when the server is shut down.
To check if it's running, I've defined another GET endpoint, which simply returns a text.
The problem arises when the server is shut down. I can't find a way to capture the contents of the returned value in the bot's process sequence (which should be "Error," a number other than 200, or a list? ...?).
I'm not entirely clear on how the Return Value and the Name and Type parameters of the Specif type work in this case.
Can anyone help me? I need to obtain this data to perform a Branch on a condition and redirect my bot's process.

Solved Solved
0 4 159
1 ACCEPTED SOLUTION

JSO
Silver 2
Silver 2

In the end, I opted for a different approach.
Nothing prevents me from calling an endpoint in a bot using a script call instead of a webHook call.
If you do it the first way, it's easier to control the fact that a URL doesn't exist and then act accordingly.
You just need to create a GAS script like this:

JSO_0-1742037206614.png

In the PROCESS the Return Value must be marked as Yes/No.
Then, in the next step of the bot, it checks if it returned true, and if not, it stops.

I found it easier than trying to control the WebHook response (which I still don't know how to do).

View solution in original post

4 REPLIES 4

Typically server errors are with 500 or 503 error code.

Please take a look at the last section of the following article.

Invoke the API - AppSheet Help

 

Thanks for the information.
Although I see that's for the AppSheet Data API.
In my case, it's my own Endpoint, and I'm not using a Google Script to call it, but rather an WebHook.
My question is about how the data returned by a GET sent via WebHook is collected, and more specifically, if there's an error code. Or does the WebHook not return anything?

JSO
Silver 2
Silver 2

In the end, I opted for a different approach.
Nothing prevents me from calling an endpoint in a bot using a script call instead of a webHook call.
If you do it the first way, it's easier to control the fact that a URL doesn't exist and then act accordingly.
You just need to create a GAS script like this:

JSO_0-1742037206614.png

In the PROCESS the Return Value must be marked as Yes/No.
Then, in the next step of the bot, it checks if it returned true, and if not, it stops.

I found it easier than trying to control the WebHook response (which I still don't know how to do).

Nice workaround. Thank you for the update.