Smart use of Zapier

Hello,
Having some questions on Zapier. Hope that experienced users can help :slight_smile:
I have managed to create my first Zap. It basically publish a link with a title on the Facebook page, every time user have posted some new topic in the Discourse forum. I’m trying to figure out how to make it smarter. For example, I want to publish posts only from a specific category or set a timer between the posts.
The first idea that came to my mind was to use a third tool - code (JS, python or any other PL). I saw that there is integration between discourse and code but I can’t understand how how can I do the following logic:

  1. New post in Discourse community.
  2. Run some code that do stuff (like set image, check category and so on).
  3. Publish the post on the Facebook page if needed.

Is it possible to achieve this with Zapier? If so, how can I do this?

1 Like

You can use webhooks for this. Have a look at Discourse Webhooks and Zapier for details about how to set it up.

2 Likes

Thank you for your fast reply :slight_smile: . It looks like Zapier’s webhooks are premium now.
Is there any other way to achieve it?

Yes, you can add a Filter Step on Zapier to filter posts by their category id. I am not sure if Zapier filters are only available on premium plans though. Have a look at the ’ Configuring which posts the Zap will retrieve’ and ’ Adding a filter step for finer control over posts’ sections of this topic: Using the Zapier Discourse Zap Templates.

If you are on a Zapier premium plan, it will be cheaper to use a Discourse webhook than a Zapier filter to control which posts trigger the Zap. If a Zap is stopped with a filter, it is still counted as a task on Zapier.

1 Like

Thank you but I think I’ll try my luck with integromat. Small Webhook question :slight_smile:
I have created a webhook that sends a POST request every time user opened a new topic. But I don’t understand how the JSON looks like. In the events I have:

{
  "ping": "OK"
}

How can I expand the JSON to contain all the needed data?

The JSON you posted is the JSON that is generated when you click the webhook’s Ping button. Try creating a new topic on your site and then look at the request data for that event. You should see a lot more data there.

I see. Is it possible to POST the data, without actually creating a new thread? Maybe some dev mode?