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 and articles. It also supports managing comments on articles, including creating, updating, deleting, and spam checking comments.

For the Cập Nhật (Update) operation on the Default resource (which corresponds to "Blog"), the node updates an existing blog identified by its ID with new data provided in JSON format.

Common scenarios where this node is beneficial include:

  • Automating content management workflows by programmatically updating blog details.
  • Integrating Sapo blog updates into larger automation pipelines, e.g., syncing blog metadata from other systems.
  • Quickly modifying blog properties such as title, handle, comment settings, or template suffix without manual intervention.

Example use case:

  • Updating a blog's title and template after a rebranding effort by providing the blog ID and new JSON data describing the changes.

Properties

Name Meaning
ID Blog The unique numeric identifier of the blog to update.
Dữ Liệu Blog (Data) A JSON object containing the blog fields to update, such as title, handle, commentable status, and template suffix. Example:
json { "title": "Company News", "handle": "news", "commentable": true, "template_suffix": "alternate" }

Output

The output is a JSON object representing the updated blog resource returned from the Sapo API after the update operation. This typically includes the blog's current state with all its properties reflecting the applied changes.

If the update is successful, the output contains the updated blog data. If an error occurs, and the node is set to continue on failure, the output will contain an error field with the error message.

No binary data output is involved in 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 SapoApiBase class for making authenticated API requests to manage blogs.
  • Proper permissions on the Sapo account are necessary to update blog resources.

Troubleshooting

  • Common issues:

    • Providing an invalid or non-existent blog ID will result in an error from the API indicating the blog was not found.
    • Malformed JSON in the "Dữ Liệu Blog" property can cause request failures.
    • Insufficient permissions or expired API credentials will lead to authentication errors.
  • Error messages:

    • "Blog not found": Verify the blog ID is correct and exists.
    • "Invalid JSON data": Check the JSON syntax and required fields in the data property.
    • "Authentication failed": Ensure the API key credential is valid and has proper access rights.

To resolve these errors, confirm input values, validate JSON formatting, and verify API credentials.

Links and References

Discussion