Sapo Blog icon

Sapo Blog

Manage Sapo blogs and articles

Overview

This node manages blogs and articles within the Sapo platform, allowing users to perform various operations such as creating, updating, retrieving, and deleting blogs, articles, and comments. Specifically for the "Blog" resource with the "Tạo Bình Luận" (Create Comment) operation, it enables adding a new comment to a blog article by specifying the blog ID, article ID, and comment data.

Common scenarios include:

  • Adding user feedback or discussion points to blog articles.
  • Moderating and managing comments on blog posts.
  • Automating blog content management workflows.

Practical example:

  • Automatically posting a comment from a form submission on a specific blog article to engage readers.

Properties

Name Meaning
ID Blog The unique numeric identifier of the blog where the comment will be created.
Dữ Liệu Bình Luận (Comment Data) JSON object containing the comment details such as author name, email, comment body, and IP address. Example: { "author": "John Doe", "email": "john@example.com", "body": "Great article!", "ip": "127.0.0.1" }

Output

The output is a JSON object representing the response from the Sapo API after creating the comment. This typically includes details of the newly created comment such as its ID, author, content, timestamps, and status.

No binary data output is involved in this operation.

Example output structure (simplified):

{
  "id": 123,
  "author": "John Doe",
  "email": "john@example.com",
  "body": "Great article!",
  "ip": "127.0.0.1",
  "created_at": "2024-06-01T12:00:00Z",
  "status": "approved"
}

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • The node depends on the SapoApiBase class which handles communication with the Sapo backend services.
  • Proper permissions on the Sapo account to create comments on blog articles.

Troubleshooting

  • Common issues:

    • Invalid or missing blog ID or article ID can cause failures.
    • Malformed JSON in the comment data property may result in errors.
    • Insufficient API permissions or expired credentials will prevent comment creation.
  • Error messages:

    • "Invalid blog ID" or "Article not found" indicates incorrect identifiers.
    • "Unauthorized" suggests problems with API authentication.
    • "Malformed JSON" points to syntax errors in the comment data input.
  • Resolutions:

    • Verify that the blog and article IDs exist and are correct.
    • Ensure the comment data JSON is properly formatted.
    • Check and update API credentials if necessary.
    • Use the "Continue On Fail" option in n8n to handle errors gracefully during workflow execution.

Links and References

Discussion