Skip to content

document how to use (and validate) webhooks #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zeke opened this issue Jan 22, 2024 · 11 comments · Fixed by #259
Closed

document how to use (and validate) webhooks #195

zeke opened this issue Jan 22, 2024 · 11 comments · Fixed by #259

Comments

@zeke
Copy link
Member

zeke commented Jan 22, 2024

We should update the README with an example of how to set a webhook.

This page has some prior art: https://replicate.com/docs/webhooks#setting-webhooks

await replicate.predictions.create({
  version: "d55b9f2d...",
  input: { prompt: "call me later maybe" },
  webhook: "https://example.com/replicate-webhook",
  webhook_events_filter: ["completed"], // optional
});
@platform-kit
Copy link

@zeke Is this info still accurate? Some time in the last few days all the webhooks for my app have stopped working. Need a solution ASAP.

@zeke
Copy link
Member Author

zeke commented Feb 7, 2024

@platform-kit this should still work. Please email team@replicate.com and share some details about the predictions you ran that have failing webhooks.

@platform-kit
Copy link

Just did that.

Sharing this here too for posterity -
https://discord.com/channels/775512803439280149/1203740306722398268/1204514916074266714

Just like the other users report, it's ALL predictions.

@Pwntus
Copy link
Member

Pwntus commented Feb 7, 2024

@zeke
Copy link
Member Author

zeke commented Feb 7, 2024

Thanks @platform-kit and @Pwntus for following up. 👍🏼

@zeke zeke closed this as completed Feb 7, 2024
@zeke zeke reopened this Feb 7, 2024
@zeke
Copy link
Member Author

zeke commented Feb 7, 2024

Whoops re-opening because we still need to document webhooks here. 😅

@mattt
Copy link
Contributor

mattt commented Feb 7, 2024

@zeke See also #200

@lukeingalls
Copy link

lukeingalls commented Mar 20, 2024

One thing that caught me by surprise with webhooks is that a 301 error silently fails to deliver. I hadn't realized the route I had provided, domain.com/api/..., was returning 301 to www.domain.com/api/.... It'd be nice if the redirect was followed or to be able to see in the web interface the status of webhook deliveries.

If there's a better place to raise this LMK.

@zeke
Copy link
Member Author

zeke commented Mar 25, 2024

Hey @lukeingalls thanks for reporting. Checking with our webhook provider to see if we can support following redirects.

@zeke
Copy link
Member Author

zeke commented Mar 26, 2024

@lukeingalls our webhook service doesn't support following redirects, and is not likely to. You will need to use the ultimate destination URL when specifying your webhook.

It'd be nice [...] to be able to see in the web interface the status of webhook deliveries.

☝🏼 Yeah that's a great suggestion. I've made a ticket for this internally.

@AurelTBE
Copy link

Hi, I had the same issue between "domain.com/api/..." and "www.domain.com/api/..." for my webhook.
It would be nice to add a "warning" or attention drawing in the documentation, to avoid other people getting this issue if it can't be changed.

@zeke zeke changed the title document how to use webhooks document how to use (and validate) webhooks May 10, 2024
@zeke zeke closed this as completed in #259 May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants