Hi guys,
I’m developing an app which gets data from external API and returns them into a board. The app works perfectly fine if I use build-in trigger (“When column changes”). However, I’m forced to use custom trigger (“When text or number column changes”) to restrict trigger column type. To achieve that, app uses custom trigger in which specifies trigger column type to text, long text or number only.
I implemented subscription/unsubscription endpoints to get the webhookUrl and manage the subscription. I’m able to call the webhookUrl with in Postman using tunnel to my localhost. The action is called properly as expected.
Now, I’m stuck with calling it programmatically. I thought, I’d create a new webhook which should call the webhookUrl via my app:
- When column changes
- Call my monday app endpoint (using monday code)
- Select proper webhookUrl from app storage
- Call selected webhookUrl
- Action trigger is called and make the integration running
Questions:
- Does it make sense to you?
- Is there any simpler way to how to make it?
- If not, how to create a webhook pointing to your app? I use hostname from subscribe request however it looks kind of dummy.
Thank you in advance!
Here is how I think it could work.
Hello there @MichalJurnik,
Would you be able to please fill this form adding as much information as possible to it so that our team can take a look into it?
1 Like
Thank you, @Matias.Monday! I submitted the form with a question regarding whether this is the best approach.
I managed to create a board webhook that triggers my app’s endpoint, which then calls the webhook URL. However, it feels like a roundabout way of doing things. I’d appreciate any suggestions for a more direct solution!
Hi @MichalJurnik,
I took a look into your email and I believe your flow looks good!
But if you have more questions, please feel free to reply in the email thread we have
1 Like
Thank you @Matias.Monday one more time. I was able to develop a solution based on my idea and your help.
The magic trick is that you need to create an integration of your app (manually) to call your subscribe endpoint (app) which creates webhook (automatically) calling your trigger. Once the trigger is called, you need to identify the webhook and call proper webhookUrl
Step by step solution:
- custom trigger calls my app’s subscribe endpoint. There are subscriptionId and webhookUrl in call’s payload
- the app creates a new webhook via API. The webhook url aims to app’s trigger-call endpoint and contains parameter subscriptionId in url. Example: https://here.should.be.your.domain/trigger-call?subscriptionId=123. Note: there needs to be implemented two endpoints for route trigger-call. The first without authorization returning challenge and the second maintain your workflow.
- the app stores subscriptionId and webhookUrl in app’s local storage
- once the webhook trigger is performed, the trigger-call endpoint is called. Here the app extracts the subscriptionId parameter from url. Based on subscriptionId gets webhookUrl from app’s local storage and call webhookUrl generated from the step 1. Obviously, the call needs to be authorized in header and contains parameters in body based on your custom trigger output parameters.
The final outcome looks like:
Thank you for sharing this @MichalJurnik !!