### Trigger Google My Business Post with Promotion Details Source: https://docs.feedhive.com/triggers/reference This example demonstrates triggering a Google My Business post with promotional details, including coupon code, start/end dates, CTA, and terms. This requires the 'Google My Business Only' variables. ```Shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Special offer this week!", "title": "Winter Sale", "coupon_code": "WINTER2024", "start_date": "2024-01-01T00:00:00Z", "end_date": "2024-01-31T23:59:59Z", "cta": "SHOP_NOW", "terms_and_conditions": "Valid while supplies last. Cannot be combined with other offers." }' ``` ```NodeJS const fetch = require('node-fetch'); fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Special offer this week!', title: 'Winter Sale', coupon_code: 'WINTER2024', start_date: '2024-01-01T00:00:00Z', end_date: '2024-01-31T23:59:59Z', cta: 'SHOP_NOW', terms_and_conditions: 'Valid while supplies last. Cannot be combined with other offers.' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Python import requests import json url = "https://api.feedhive.com/triggers/xxxxx" headers = {"Content-Type": "application/json"} payload = { "text": "Special offer this week!", "title": "Winter Sale", "coupon_code": "WINTER2024", "start_date": "2024-01-01T00:00:00Z", "end_date": "2024-01-31T23:59:59Z", "cta": "SHOP_NOW", "terms_and_conditions": "Valid while supplies last. Cannot be combined with other offers." } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### Trigger Post with Platform-Specific Variables Source: https://docs.feedhive.com/triggers/reference This example shows how to trigger a FeedHive automation using platform-specific variables like 'title' and 'link', which are applicable to YouTube, Google My Business, and Pinterest. It also includes basic 'text' content. ```Shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Check out our latest video!", "title": "Amazing Tutorial Video", "link": "https://example.com/more-info" }' ``` ```NodeJS const fetch = require('node-fetch'); fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Check out our latest video!', title: 'Amazing Tutorial Video', link: 'https://example.com/more-info' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Python import requests import json url = "https://api.feedhive.com/triggers/xxxxx" headers = {"Content-Type": "application/json"} payload = { "text": "Check out our latest video!", "title": "Amazing Tutorial Video", "link": "https://example.com/more-info" } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### MCP Call Tool Request (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Example JSON request for executing a specific trigger (tool) with provided arguments. This is used to programmatically invoke FeedHive triggers. ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "trigger_abc123", "arguments": { "text": "Hello from MCP!", "imageUrl": "https://example.com/image.png" } } } ``` -------------------------------- ### Trigger Post with AI Prompt Source: https://docs.feedhive.com/triggers/reference This example shows how to trigger a FeedHive automation using the 'prompt' variable to generate post content with an AI model. It includes scheduling and a media URL. Ensure an AI model is assigned to the trigger. ```Shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "prompt": "Write a social media post about the benefits of remote work", "scheduled": "2024-01-15T10:00:00Z", "media_urls": "https://example.com/remote-work.jpg" }' ``` ```NodeJS const fetch = require('node-fetch'); fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'Write a social media post about the benefits of remote work', scheduled: '2024-01-15T10:00:00Z', media_urls: 'https://example.com/remote-work.jpg' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Python import requests import json url = "https://api.feedhive.com/triggers/xxxxx" headers = {"Content-Type": "application/json"} payload = { "prompt": "Write a social media post about the benefits of remote work", "scheduled": "2024-01-15T10:00:00Z", "media_urls": "https://example.com/remote-work.jpg" } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### Trigger Post via GET Request (Shell) Source: https://docs.feedhive.com/triggers/how-to-trigger This snippet shows a legacy method for triggering FeedHive posts using a GET request with query parameters. The text content must be URL-encoded. This method is deprecated and POST requests are recommended. ```shell text="Hello world! \n\nThis is a test post.\n\n😊" encodedText=$(echo -n "$text" | jq -sRr @uri) curl -X GET "https://api.feedhive.com/triggers/xxxxx?text=${encodedText}" ``` -------------------------------- ### Trigger Post with Text Content Source: https://docs.feedhive.com/triggers/reference This example demonstrates how to trigger a FeedHive automation using the 'text' variable for post content, along with scheduling and media URLs. It requires a valid trigger endpoint and post details. ```Shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Your post content here", "scheduled": "2024-01-15T10:00:00Z", "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] }' ``` ```NodeJS const fetch = require('node-fetch'); fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Your post content here', scheduled: '2024-01-15T10:00:00Z', media_urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'] }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Python import requests import json url = "https://api.feedhive.com/triggers/xxxxx" headers = {"Content-Type": "application/json"} payload = { "text": "Your post content here", "scheduled": "2024-01-15T10:00:00Z", "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### Trigger Post via POST Request (Shell) Source: https://docs.feedhive.com/triggers/how-to-trigger This snippet demonstrates how to send a POST request to trigger a FeedHive post. It includes example data for post content, scheduling, and media URLs. The request body should be in JSON format. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Your post content here", "scheduled": "2024-01-15T10:00:00Z", "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] }' ``` -------------------------------- ### Send AI Prompt to FeedHive Trigger Source: https://docs.feedhive.com/triggers/introduction This snippet demonstrates how to send a prompt to a FeedHive trigger using the POST method. It includes the request body structure with 'prompt' and 'media_urls' fields. This method is recommended for its flexibility and lack of URL length limitations. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "prompt": "Create a post about the benefits of morning exercise", "media_urls": "https://example.com/workout-image.jpg" }' ``` ```nodejs // NodeJS example (implementation not provided in text, conceptual representation) // const axios = require('axios'); // axios.post('https://api.feedhive.com/triggers/xxxxx', { // prompt: 'Create a post about the benefits of morning exercise', // media_urls: 'https://example.com/workout-image.jpg' // }) // .then(response => console.log(response)) // .catch(error => console.error(error)); ``` ```python # Python example (implementation not provided in text, conceptual representation) # import requests # url = "https://api.feedhive.com/triggers/xxxxx" # payload = { # "prompt": "Create a post about the benefits of morning exercise", # "media_urls": "https://example.com/workout-image.jpg" # } # response = requests.post(url, json=payload) # print(response.json()) ``` -------------------------------- ### MCP Call Tool Error Response (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Provides an example of an error response from calling a tool (trigger). This indicates failure during trigger execution with a specific error message. ```json { "jsonrpc": "2.0", "id": 3, "error": { "code": -32603, "message": "Trigger execution failed: Invalid input" } } ``` -------------------------------- ### Send Prompt to FeedHive Trigger (Shell, NodeJS, Python) Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers This snippet demonstrates how to send a POST request to a FeedHive trigger endpoint. It includes examples in cURL (Shell), NodeJS, and Python. The request body should contain a 'prompt' field for AI content generation and optionally 'media_urls'. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "prompt": "Create a post about the benefits of morning exercise", "media_urls": "https://example.com/workout-image.jpg" }' ``` ```javascript const fetch = require('node-fetch'); async function triggerFeedHive() { const response = await fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'Create a post about the benefits of morning exercise', media_urls: 'https://example.com/workout-image.jpg' }) }); const data = await response.json(); console.log(data); } triggerFeedHive(); ``` ```python import requests import json def trigger_feedhive(): url = "https://api.feedhive.com/triggers/xxxxx" payload = { "prompt": "Create a post about the benefits of morning exercise", "media_urls": "https://example.com/workout-image.jpg" } headers = { 'Content-Type': 'application/json' } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) trigger_feedhive() ``` -------------------------------- ### Trigger Post with Custom Template Variables Source: https://docs.feedhive.com/triggers/reference This example illustrates triggering a FeedHive automation using custom variables that are defined within a template. These variables, like 'blog_title' and 'blog_url', are passed in the trigger request to populate the template. ```Shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Check out this blog post!", "blog_title": "My Amazing Blog Post", "blog_url": "https://example.com/blog-post", "author_name": "John Doe" }' ``` ```NodeJS const fetch = require('node-fetch'); fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Check out this blog post!', blog_title: 'My Amazing Blog Post', blog_url: 'https://example.com/blog-post', author_name: 'John Doe' }) }) .then(response => response.json()) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` ```Python import requests import json url = "https://api.feedhive.com/triggers/xxxxx" headers = {"Content-Type": "application/json"} payload = { "text": "Check out this blog post!", "blog_title": "My Amazing Blog Post", "blog_url": "https://example.com/blog-post", "author_name": "John Doe" } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.json()) ``` -------------------------------- ### GET /triggers/{id} (Legacy) Source: https://docs.feedhive.com/triggers/how-to-trigger Trigger a post using a legacy GET request. Data is sent as query parameters. This method is deprecated and not recommended for new implementations. ```APIDOC ## GET /triggers/{id} (Legacy) ### Description Triggers a content post via a legacy GET request. Post data is sent as URL-encoded query parameters. This method is deprecated. ### Method GET ### Endpoint `https://api.feedhive.com/triggers/xxxxx` ### Parameters #### Query Parameters - **text** (string) - Required - The content of the post. Must be URL-encoded. ### Request Example ```shell text="Hello world! \n\nThis is a test post.\n\n😊" encodedText=$(echo -n "$text" | jq -sRr @uri) curl -X GET "https://api.feedhive.com/triggers/xxxxx?text=${encodedText}" ``` ### Response #### Success Response (200) (Response details not provided in the source text) #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### Create and Publish Post Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers Set up a trigger to create and immediately publish a post. This can include text, media, and a scheduled time. ```APIDOC ## POST /triggers/xxxxx ### Description This endpoint triggers the creation and immediate publication of a post. It supports defining the post text, media URLs, and a specific schedule time. ### Method POST ### Endpoint `https://api.feedhive.com/triggers/xxxxx` ### Parameters #### Query Parameters None #### Request Body - **text** (string) - Required - The content of the post. - **scheduled** (string) - Optional - The date and time for the post to be scheduled, in ISO 8601 format (e.g., "2026-01-15T14:30:00Z"). If not provided, it's published immediately. - **media_urls** (array of strings) - Optional - URLs for media to be included in the post. ### Request Example ```json { "text": "Check out our latest blog post!", "scheduled": "2026-01-15T14:30:00Z", "media_urls": ["https://example.com/featured-image.jpg"] } ``` ### Response #### Success Response (200) No specific response body is detailed, but the action of creating and publishing the post is performed. #### Response Example (No example provided in source) ``` -------------------------------- ### FeedHive Post and Comment Data Source: https://docs.feedhive.com/notifications/reference This section details the structure of the payload for post and comment data, including available fields and an example. ```APIDOC ## FeedHive Post and Comment Data ### Description This describes the structure of the payload containing information about posts and comments in FeedHive. It includes fields for post and comment identifiers, timestamps, user details, comment text, and post excerpts. ### Parameters #### Request Body - **post_id** (string) - Unique identifier for the post in FeedHive - **comment_id** (string) - Unique identifier for the comment - **commented_at** (string) - ISO 8601 timestamp when the comment was added - **commented_by** (string) - Unique identifier of the user who commented - **commented_by_name** (string) - Display name of the user who commented - **commented_by_email** (string) - Email address of the user who commented - **comment_text** (string) - The full text content of the comment - **post_excerpt** (string) - The first portion of the post caption (truncated) - **post** (NotificationPost) - Full post data object ### Request Example ```json { "post_id": "xxxx-abcd-1234", "comment_id": "yyyy-zxyw-4321", "commented_at": "2024-08-01T12:00:00.000Z", "commented_by": "zzzz-efgh-5678", "commented_by_name": "John Doe", "commented_by_email": "johndoe@gmail.com", "comment_text": "Great post. Perhaps add another image?", "post_excerpt": "This is the first part of the post caption for a Fa...", "post": { "content": [ { "text": "This is the first part of the post caption for a Facebook post.", "media": [ "https://example.com/image1.jpg" ] } ], "labels": ["Team Collaboration", "Feedback Received"], "postNotes": "Awaiting team feedback before publishing", "title": "Draft Post for Review" } } ``` ### Response #### Success Response (200) - **post_id** (string) - Unique identifier for the post in FeedHive - **comment_id** (string) - Unique identifier for the comment - **commented_at** (string) - ISO 8601 timestamp when the comment was added - **commented_by** (string) - Unique identifier of the user who commented - **commented_by_name** (string) - Display name of the user who commented - **commented_by_email** (string) - Email address of the user who commented - **comment_text** (string) - The full text content of the comment - **post_excerpt** (string) - The first portion of the post caption (truncated) - **post** (NotificationPost) - Full post data object #### Response Example ```json { "post_id": "xxxx-abcd-1234", "comment_id": "yyyy-zxyw-4321", "commented_at": "2024-08-01T12:00:00.000Z", "commented_by": "zzzz-efgh-5678", "commented_by_name": "John Doe", "commented_by_email": "johndoe@gmail.com", "comment_text": "Great post. Perhaps add another image?", "post_excerpt": "This is the first part of the post caption for a Fa...", "post": { "content": [ { "text": "This is the first part of the post caption for a Facebook post.", "media": [ "https://example.com/image1.jpg" ] } ], "labels": ["Team Collaboration", "Feedback Received"], "postNotes": "Awaiting team feedback before publishing", "title": "Draft Post for Review" } } ``` ``` -------------------------------- ### MCP General Error Response (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Example of a general JSON-RPC error response, such as for invalid parameters. This follows the JSON-RPC 2.0 error structure. ```json { "jsonrpc": "2.0", "id": 3, "error": { "code": -32602, "message": "Invalid params: Missing required field 'text'" } } ``` -------------------------------- ### List Available Tools (Triggers) Source: https://docs.feedhive.com/automation-integrations/mcp Lists all available FeedHive triggers, exposed as tools, with their names, descriptions, and input schemas. ```APIDOC ## POST /mcp ### Description Lists all available triggers as tools. Each trigger is exposed with the naming convention `trigger_{id}`. ### Method POST ### Endpoint `https://mcp.feedhive.com` ### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC protocol version, must be "2.0". - **id** (integer) - Required - A unique identifier for the request. - **method** (string) - Required - The method to call, must be "tools/list". ### Request Example ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/list" } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version, "2.0". - **id** (integer) - The ID of the request. - **result** (object) - Contains a list of available tools. - **tools** (array) - An array of tool objects. - **name** (string) - The name of the tool (trigger), e.g., `trigger_abc123`. - **description** (string) - A description of the trigger. - **inputSchema** (object) - The JSON schema defining the expected input for the trigger. #### Response Example ```json { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "trigger_abc123", "description": "Create a new social media post", "inputSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "Post content" }, "imageUrl": { "type": "string", "description": "Optional image URL" } }, "required": ["text"] } } ] } } ``` ``` -------------------------------- ### Create and Publish Post Trigger Source: https://docs.feedhive.com/triggers/introduction Sets up a trigger to both create and immediately publish a post. Additional parameters like 'scheduled' for specific timing can be included in the JSON payload. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ \ "text": "Check out our latest blog post!", \ "scheduled": "2026-01-15T14:30:00Z", \ "media_urls": ["https://example.com/featured-image.jpg"] \ }' ``` -------------------------------- ### MCP Initialize Request (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Demonstrates the JSON payload for initializing an MCP session. This request includes protocol version, client information, and capabilities. ```json { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "your-mcp-client", "version": "1.0.0" } } } ``` -------------------------------- ### Initialize Session Source: https://docs.feedhive.com/automation-integrations/mcp Initializes the MCP session and returns server capabilities, including protocol version and supported features. ```APIDOC ## POST /mcp ### Description Initializes the MCP session and returns server capabilities. ### Method POST ### Endpoint `https://mcp.feedhive.com` ### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC protocol version, must be "2.0". - **id** (integer) - Required - A unique identifier for the request. - **method** (string) - Required - The method to call, must be "initialize". - **params** (object) - Optional - Parameters for the initialize method. - **protocolVersion** (string) - Optional - The desired protocol version. - **capabilities** (object) - Optional - Client capabilities. - **clientInfo** (object) - Optional - Information about the client. - **name** (string) - Required - The name of the client application. - **version** (string) - Required - The version of the client application. ### Request Example ```json { "jsonrpc": "2.0", "id": 1, "method": "initialize", "params": { "protocolVersion": "2024-11-05", "capabilities": {}, "clientInfo": { "name": "your-mcp-client", "version": "1.0.0" } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version, "2.0". - **id** (integer) - The ID of the request. - **result** (object) - The result of the initialization. - **protocolVersion** (string) - The server's supported protocol version. - **capabilities** (object) - Server capabilities. - **serverInfo** (object) - Information about the server. - **name** (string) - The name of the server. - **version** (string) - The version of the server. #### Response Example ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": {} }, "serverInfo": { "name": "feedhive-mcp-server", "version": "1.0.0" } } } ``` ``` -------------------------------- ### Create a Draft Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers Set up a trigger to create a new draft. You can provide post content, media URLs, labels, and select social accounts. ```APIDOC ## POST /triggers/xxxxx ### Description This endpoint triggers the creation of a new draft in FeedHive. You can specify the post content, media URLs, labels, and target social accounts. ### Method POST ### Endpoint `https://api.feedhive.com/triggers/xxxxx` ### Parameters #### Query Parameters None #### Request Body - **text** (string) - Required - The main content of the post. - **media_urls** (array of strings) - Optional - URLs for media to be included in the post. - **label** (string) - Optional - A label to assign to the draft. - **social_accounts** (array of strings) - Optional - Identifiers for the social accounts where the post should be prepared. ### Request Example ```json { "text": "Your post content here", "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] } ``` ### Response #### Success Response (200) No specific response body is detailed, but the action of creating a draft is performed. #### Response Example (No example provided in source) ``` -------------------------------- ### MCP Initialize Response (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Illustrates the expected JSON response after a successful initialization of an MCP session. It contains server capabilities and information. ```json { "jsonrpc": "2.0", "id": 1, "result": { "protocolVersion": "2024-11-05", "capabilities": { "tools": {} }, "serverInfo": { "name": "feedhive-mcp-server", "version": "1.0.0" } } } ``` -------------------------------- ### Create Draft from Template Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers Set up a trigger to create a new draft using a pre-defined post template. Variables within the template can be populated via the request body. ```APIDOC ## POST /triggers/xxxxx ### Description This endpoint triggers the creation of a new draft using a specified post template. Variables defined in the template can be supplied in the request body. ### Method POST ### Endpoint `https://api.feedhive.com/triggers/xxxxx` ### Parameters #### Query Parameters None #### Request Body - **variable_name** (string) - Required/Optional - Values for the template variables (e.g., `title-of-blogpost`, `excerpt-of-blogpost`, `link-to-blogpost`). The requirement depends on whether the variables are mandatory in the template. ### Request Example ```json { "title-of-blogpost": "My Amazing Blog Post", "excerpt-of-blogpost": "This is a short excerpt of my amazing blog post.", "link-to-blogpost": "https://example.com/blog-post" } ``` ### Response #### Success Response (200) No specific response body is detailed, but the action of creating a draft from a template is performed. #### Response Example (No example provided in source) ``` -------------------------------- ### Create and Publish Post with FeedHive Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers This trigger automates the creation and immediate publishing of a post. It accepts post content, media URLs, and a scheduled time. This is useful for instantly sharing content via an API call. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Check out our latest blog post!", "scheduled": "2026-01-15T14:30:00Z", "media_urls": ["https://example.com/featured-image.jpg"] }' ``` ```nodejs fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Check out our latest blog post!', scheduled: '2026-01-15T14:30:00Z', media_urls: ['https://example.com/featured-image.jpg'] }) }); ``` ```python import requests url = 'https://api.feedhive.com/triggers/xxxxx' data = { 'text': 'Check out our latest blog post!', 'scheduled': '2026-01-15T14:30:00Z', 'media_urls': ['https://example.com/featured-image.jpg'] } requests.post(url, json=data) ``` -------------------------------- ### Create Draft Trigger (Basic) Source: https://docs.feedhive.com/triggers/introduction Configures a trigger to create a new draft. The content and media for the draft can be sent in the JSON payload of the POST request. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ \ "text": "Your post content here", \ "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] \ }' ``` -------------------------------- ### Create a Draft with FeedHive Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers Set up a trigger to create a new draft post in FeedHive. You can specify the post content, media URLs, and optionally assign a label and select social accounts. This enables automated content creation. ```shell curl -X POST https://api.feedhive.com/triggers/xxxxx \ -d '{ "text": "Your post content here", "media_urls": ["https://example.com/image1.jpg", "https://example.com/image2.jpg"] }' ``` ```nodejs fetch('https://api.feedhive.com/triggers/xxxxx', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ text: 'Your post content here', media_urls: ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'] }) }); ``` ```python import requests url = 'https://api.feedhive.com/triggers/xxxxx' data = { 'text': 'Your post content here', 'media_urls': ['https://example.com/image1.jpg', 'https://example.com/image2.jpg'] } requests.post(url, json=data) ``` -------------------------------- ### Publish a Draft Trigger Source: https://docs.feedhive.com/team-and-white-label/automation-how-to-use-triggers Set up a trigger to publish a pre-created draft. When the trigger URL is called, FeedHive will publish the selected draft. ```APIDOC ## POST /triggers/xxxxx ### Description This endpoint triggers the publication of a pre-created draft in FeedHive. ### Method POST ### Endpoint `https://api.feedhive.com/triggers/xxxxx` ### Parameters #### Query Parameters None #### Request Body None ### Request Example ```bash curl -X POST https://api.feedhive.com/triggers/xxxxx ``` ### Response #### Success Response (200) No specific response body is detailed, but the action of publishing the draft is performed. #### Response Example (No example provided in source) ``` -------------------------------- ### Call a Tool (Execute Trigger) Source: https://docs.feedhive.com/automation-integrations/mcp Executes a specific FeedHive trigger by calling it with the provided arguments, based on its defined input schema. ```APIDOC ## POST /mcp ### Description Executes a specific trigger by calling it with the provided arguments. ### Method POST ### Endpoint `https://mcp.feedhive.com` ### Request Body - **jsonrpc** (string) - Required - Specifies the JSON-RPC protocol version, must be "2.0". - **id** (integer) - Required - A unique identifier for the request. - **method** (string) - Required - The method to call, must be "tools/call". - **params** (object) - Required - Parameters for the tools/call method. - **name** (string) - Required - The name of the tool (trigger) to execute, e.g., `trigger_abc123`. - **arguments** (object) - Required - The arguments to pass to the trigger, matching its `inputSchema`. ### Request Example ```json { "jsonrpc": "2.0", "id": 3, "method": "tools/call", "params": { "name": "trigger_abc123", "arguments": { "text": "Hello from MCP!", "imageUrl": "https://example.com/image.png" } } } ``` ### Response #### Success Response (200) - **jsonrpc** (string) - The JSON-RPC protocol version, "2.0". - **id** (integer) - The ID of the request. - **result** (object) - The result of the trigger execution. - **content** (array) - The content returned by the trigger. #### Response Example (Success) ```json { "jsonrpc": "2.0", "id": 3, "result": { "content": [ { "type": "text", "text": "Trigger executed successfully" } ] } } ``` #### Response Example (Error) ```json { "jsonrpc": "2.0", "id": 3, "error": { "code": -32603, "message": "Trigger execution failed: Invalid input" } } ``` ``` -------------------------------- ### MCP List Tools Request (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Shows the JSON request to list all available triggers as tools within the MCP system. This helps clients discover actionable triggers. ```json { "jsonrpc": "2.0", "id": 2, "method": "tools/list" } ``` -------------------------------- ### MCP List Tools Response (JSON) Source: https://docs.feedhive.com/automation-integrations/mcp Presents the JSON response detailing the available tools (FeedHive triggers). Each tool includes its name, description, and input schema. ```json { "jsonrpc": "2.0", "id": 2, "result": { "tools": [ { "name": "trigger_abc123", "description": "Create a new social media post", "inputSchema": { "type": "object", "properties": { "text": { "type": "string", "description": "Post content" }, "imageUrl": { "type": "string", "description": "Optional image URL" } }, "required": ["text"] } } ] } } ```