Question

Rest Hook: check when POST to targetURL is still working

  • 13 November 2023
  • 0 replies
  • 26 views

Hi!

First of all thanks for your support!

Copying question from here, since the developer forum seems better fit for it:

---
I am trying to setup an application using Rest Hooks and at the moment I have everything working as follows

1 - When a user sets up a Zap then Zapier calls the subscribe hook endpoint from our API and we save the targetUrl internally
2 - When a user disables or deletes a Zap then Zapier calls the unsubscribe hook and we delete the targetUrl associated with the subscriber.id passed on the unsubscribe

My question, would be on how to check if a given targetUrl is still `working`. The reason to ask for this, is related to the fact the unsubscribe flow from (2) might fail, but Zapier would still disable the Zap since it would not wait for the `unsubscribe` operation to be successfully fullfilled.

The problem we might face here, is that if for any reason our API is unreachable at the time of an unsubscribe, we might have `targetUrls` in our system that are no longer `active`, since we were not able to flag those as deleted when Zapier tried to unsubscribe.


I have tried to search for documentation on this community and over internet but I could not find anything. So I am wondering what would be the best way to proceed.

I’ve checked and the POST to the targetUrl seems to return always a success following the format below and it does not look like we could use it to infer any error/failure status.:

{
"attempt": "<id>",
"id": "<id>",
"request_id": "<id>",
"status": "success"
}

 

Would you have an API we could call to check the status of the asynchronous attempt? Or an API we could use to verify the targetUrl status?

 

Thanks!


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.