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, retrieving, updating, and deleting blogs and articles. It is particularly useful for automating content management workflows, synchronizing blog data, or integrating Sapo blog content with other systems.

For the Blog - Update operation specifically, the node updates an existing blog identified by its ID with new data provided in JSON format. This can be used to modify blog titles, handles (URL slugs), comment settings, templates, and other blog attributes programmatically.

Practical Example

  • Automatically update a blog’s title and template after a marketing campaign.
  • Change the commentable status of a blog based on user feedback.
  • Synchronize blog metadata from an external CMS into Sapo.

Properties

Name Meaning
ID Blog The unique numeric identifier of the blog to update.
Dữ Liệu Blog (Blog Data) A JSON object containing the fields to update in the blog. Typical fields include:
- title: The blog's title.
- handle: URL slug for the blog.
- commentable: Boolean indicating if comments are allowed.
- template_suffix: Template variant to use for the blog display.
Users provide this JSON to specify which blog properties to change.

Output

The node outputs an array with one item containing a json field. For the update operation on a blog, the json output contains the updated blog object returned from the API, reflecting the new state of the blog after the update.

Example output structure:

{
  "id": 123,
  "title": "Updated Blog Title",
  "handle": "updated-handle",
  "commentable": true,
  "template_suffix": "alternate",
  ...
}

If the update fails and the node is set to continue on failure, the output will contain an error message instead.

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 to communicate with the Sapo backend.
  • Proper permissions on the Sapo account to update blogs are necessary.

Troubleshooting

  • Common Issues:

    • Invalid or missing blog ID: Ensure the blog ID exists and is correct.
    • Malformed JSON in the blog data property: Validate JSON syntax before running.
    • Insufficient API permissions: Verify that the API key has rights to update blogs.
    • Network or authentication errors connecting to Sapo API.
  • Error Messages:

    • Errors thrown by the node include the API error message and stack trace.
    • If the node is not set to continue on fail, it will stop execution on error.
    • To handle errors gracefully, enable "Continue On Fail" in the node settings.

Links and References

Discussion