question

tarek avatar image
tarek asked

Webhook sends data multiple times to a google apps script web app endpoint

Hi all,

We are using google apps script with a google sheet as a simple web app (API) to log specific events.

The Playfab Webhook keeps calling the endpoint over and over again for the same events.

We are not sure if the issue is with Playfab webhook, the apps script code or both.


We will appreciate any suggestion.


Notes:
- Playfab Title ID: 6B9D2
- In apps script we are using a doPost(e) and at the end we are returning the following:

return HtmlService.createHtmlOutput("");

- In Postman: the script returns HTML content, and the status is 200 OK

datawebhooks
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Rick Chen avatar image Rick Chen ♦ commented ·

Could you please describe that when you call the google apps script endpoint in Postman, how many times was your app script code executed?

0 Likes 0 ·
tarek avatar image tarek Rick Chen ♦ commented ·

When I call it, it gets executed once (as expected).

0 Likes 0 ·

1 Answer

·
Rick Chen avatar image
Rick Chen answered

We use "at least once" delivery semantics for the Webhook. This means, for any given message we will retry until we get positive confirmation from the receiver. This can create duplicates when the receiver fails to respond for some reason despite actually receiving the message. In these cases, the culprit is either the stability of the receiver or general internet randomness.

4 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tarek avatar image tarek commented ·

I see. It may be an issue with the google apps script not returning the required positive confirmation as the Webhook's expectation.
I will look for a solution in the google apps script side, and will update you if I find anything.

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ tarek commented ·

Thank you for understanding. I am looking forward to the update.

0 Likes 0 ·
Burak Sen avatar image Burak Sen tarek commented ·

Have you got any updates @tarek?

0 Likes 0 ·
tarek avatar image tarek Burak Sen commented ·

No, I am still not able to figure it out.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.