As hinted at a few weeks ago in our 3rd birthday post, you can now send posts from Ghost directly into your Slack team via a simple webhook integration!
you can now send posts from Ghost directly into your Slack team via a simple webhook integration
Is this the site.changed webhook as described here?: Ghost Webhooks
site.changed Triggered whenever any content changes in your site data or settings
Or is it something different?
Iād like to receive webhooks me too, from Ghost, when a new blog post gets published, and Iād need 1) the ids of the author(s) of the new blog post, and 2) the blog post Ghost comment_id and 3) its url. ā Iām wondering, what data gets sent to Slack? The url I presume ā and what about the author ids and the comment_id?
Background: Iām developing a blog commenting system (Talkyard), and if the above-mentioned data was included in the webhook, then this commenting system could automatically subscribe the relevant blog post author(s) in a multi-author blog to get notified about comment replies the blog readers post.
***
I notice in the screenshot thereās an āAppsā tab opened. ā Can I create my own āAppā in Ghost? Whatās the difference between this Ghost-Slack āAppā, and the integrations on the integrations page ? (Didnāt find anything when I websearched for āghost app vs integrationā :- ))
Howdy! Slack is one of our Built-in Integrations which I believe does use the webhooks you linked to, but you can make your own Custom Integrations as well:
@DavidDarnes Ok, thanks. Then that webhook is probably the one I want to use ā if it just includes enough information, I mean, not only blog post URL but also comment_id and author id. (The docs are a bit empty.)
I didnāt find documented anywhere whatās included in the webhook POST request body. If you (or someone) happen to know, itād be interesting to know. (Or, I suppose I could install Ghost locally and send a request to http://webhook.site to find out)
@KajMagnus web hooks for individual resource events such as post.published contain the same information as a GET request to the resource in question in the Admin API. The webhook payloads have this general format:
I would suggest testing this for yourself so you can play with it and see how the data looks, there are a number of sites you can set up webhook captures on such as https://webhook.site as you pointed out.
RE the Slack integration, it uses an internal events system and talks directly to the Slack API. However using the webhooks system you could create your own Slack integration using the right webhook events - you can see the full list of those when setting up webhooks in the admin.
site.changed wouldnāt be very useful for this, itās only a basic notification that something on the site has changed and doesnāt contain any information about what has changed. Itās designed for integration with static site generators where youād want to rebuild each time anything changed.