# Automated Content Sharing via Webhooks One powerful way to use Firstup’s Webhook API is to automate content sharing. For example, you may want to send newly published content from Firstup to an external CMS, intranet, or social media platform automatically whenever new content is created or updated. ## Prerequisites Before setting up a webhook for automated content sharing, ensure that: 1. You have a publicly accessible endpoint that can receive webhook events (e.g., a custom API in your CMS or a middleware service like Zapier). 2. You have API access to register webhooks via the POST /webhooks endpoint. 3. You have permission to fetch content using the GET /content API if you need additional details after receiving a webhook event. ## Step 1: Creating the Webhook Subscription To receive notifications when new content is published, you need to register a webhook that listens for `content.published` events. **Example Request** ``` POST /v2/webhooks/subscriptions { "name": "Content Published Webhook", "url": "https://your-cms.com/api/firstup-webhook", "events": ["content.published"], "active": true } ``` | Firstup Attribute | Description | | --- | --- | | `name` | A descriptive name for your webhook. | | `url` | The external system’s endpoint that will receive webhook notifications. | | `events` | The event type(s) to listen for. In this case, content.published. | | `active` | Specifies whether the webhook is active. | ## Step 2: Handling the Webhook Event Once registered, your external system will receive a `POST` request from Firstup whenever content is published. **Example Webhook Payload (Sent to Your Endpoint)** ``` { "event": "content.published", "timestamp": "2025-03-26T12:34:56Z", "data": { "contentId": "12345", "title": "Exciting Company Update!", "summary": "We're thrilled to announce a major company milestone...", "url": "https://your.firstup.io/content/12345", "author": { "name": "Jane Doe", "email": "jane.doe@example.com" }, "publishedAt": "2025-03-26T12:30:00Z" } } ``` Your system should be able to parse this payload and use the data to trigger an action, such as: * Posting the content to an external CMS * Sending notifications to employees * Sharing updates on a company intranet ## Step 3: Getting Additional Content Details (Optional) If your system needs more details about the published content, it can use the `GET /v2/content/{content_Id}` API to retrieve the full content object. **Endpoint** GET /v2/content/{content_id} **Example Request to Get Content Details** ``` GET /v2/content/12345 Authorization: Bearer YOUR_ACCESS_TOKEN ``` **Example Response** ``` { "id": "12345", "title": "Exciting Company Update!", "body": "
We're thrilled to announce...
", "author": "Jane Doe", "tags": ["company news", "announcement"], "image": "https://your.firstup.io/images/content-12345.jpg", "publishedAt": "2025-03-26T12:30:00Z" } ```