Webhook URL issue

  • 13 July 2022
  • 7 replies

Hi , is there anyway we can get the webhook URL for the zap in the response of getting all zaps?

7 replies

Userlevel 7
Badge +8

Hey @devaevent can you tell us more about your desired outcome here? Are you building an app on the developer platform or is this question more around a request for a Zapier API that allows you to access the Zaps on your account via webhooks? Let us know!

Hi @jesse  , the use case of our application is that we get the zaps from the partner API and show them on our FE and when user selects a specific zap then we want to send data using the trigger webhook.
The issue is that when getting all zaps we could not get the trigger webhook URL , and we cant send zapID along with the webhook URL when we use subscription URL.

Userlevel 7
Badge +11

Hi @devaevent

you should get the subscription url once the user has enabled the zap. That is the moment Zapier will invoke the Subscribe call in your app. Your api should then handle this call and store the subscription url. 

I do not think you can programmatically get this url before that moment. 

Yeah it gets invoked when a zap is enabled but we want to send some kind of unique identifier like a ZapID to identify that which zap has this subscription URL.

Userlevel 7
Badge +11

Ah… i do not think you can get the zap editor id outside of the partner api . You could look into using something in bundle.meta or assign your own id which would appear in bundle.subscribeData

@GetUWired  , Is there a way we can send zapID along with the subscription URL ?

Userlevel 1

Hey @devaevent!

@GetUWired is absolutely correct here, as it is not possible to access the ID of a particular Zap during subscription. The reasons for this get a bit complicated, but suffice to say the subscription to your API’s trigger event notification service doesn’t necessarily relate to a single Zap ID.

The idea of including your own ID in `bundle.subscribeData` at the time of subscription is likely the best option, however I’m not sure that such an ID could also be included with the data returned by `/v1/zaps`. Am I correct to understand that you have access to the `targetUrl` from the subscription, and access to the Zap ID from the Partner API, but the trouble arises in trying to associate those two during presentation on the frontend (FE)?

If so, I wonder whether you might find success by:

  • Including some details for your FE at the time of subscription (perhaps ``)
  • Listing the active subscriptions to your API in the FE (rather than collecting Zaps from the Partner API) and labelling & linking them with the details provided at the time of subscription (name & targetUrl)

The only catch I can see with this plan is the possibility that two Zaps share the same name, which:

  • Users could correct themselves
  • Could be mitigated with some `helpText` on your app’s trigger, letting them know that names should be unique to avoid confusion
  • Could potentially be avoided by adding some validation logic to the trigger during sample data collection (ie. if another subscription is already registered with that name, return an error)

Does that help to get you moving forward here? Please let us know if we can help further!