Actions33
- Bài Viết Actions
- Blog Actions
Overview
This node integrates with the Sapo blogging platform to manage blogs and articles programmatically. It supports operations such as creating, retrieving, updating, and deleting both blogs and articles, as well as managing comments on articles.
For the specific Resource "Bài Viết" (Article) and Operation "Tạo Mới" (Create), the node allows users to create a new article within a specified blog by providing the blog ID and the article data in JSON format. This is useful for automating content publishing workflows, such as adding new product announcements, news updates, or other blog posts directly from n8n without manual intervention.
Practical example: Automatically create a new blog article when a new product is added to your inventory system, including title, author, HTML body content, tags, and publication status.
Properties
| Name | Meaning |
|---|---|
| ID Blog | The numeric identifier of the blog where the new article will be created. |
| Dữ Liệu Bài Viết (Article Data) | A JSON object containing the article details such as title, author, HTML content (body_html), tags, and published status. Example structure: json { "title": "New Product Launch", "author": "John Doe", "body_html": "<p>Exciting announcement...</p>", "tags": "news, products", "published": true } |
Output
The node outputs an array with one element containing a json field. This json field holds the response from the Sapo API after creating the article. Typically, this includes the newly created article's details such as its ID, title, author, content, tags, publication status, timestamps, and any other metadata returned by the API.
No binary data output is produced by this operation.
Dependencies
- Requires an active connection to the Sapo API via an API key credential configured in n8n.
- The node depends on the internal
SapoApiBaseclass to handle API requests related to blogs and articles. - Proper permissions on the Sapo account are necessary to create articles within the specified blog.
Troubleshooting
Common issues:
- Invalid or missing blog ID: Ensure the blog ID provided exists and is accessible.
- Malformed JSON in the article data: Verify that the JSON structure is valid and contains all required fields.
- Authentication errors: Confirm that the API key credential is correctly set up and has sufficient permissions.
- Network or API downtime: Check connectivity and Sapo service status.
Error messages:
- Errors thrown by the node include the message from the underlying API error. For example, if the blog ID does not exist, the API might return a "Not Found" error.
- If the node is set to continue on failure, errors will be returned inside the output JSON under an
errorproperty instead of stopping execution.
Links and References
- Sapo Official API Documentation (general reference for API endpoints)
- n8n documentation on Creating Custom Nodes
- JSON formatting tools for validating article data input