Overview
This node integrates with the Postiz API to manage social media posts and related content. It supports operations such as creating posts, deleting posts, retrieving posts, uploading files, and fetching connected integrations (channels). The "Get Posts" operation specifically allows users to retrieve a list of posts filtered by time parameters (week, day, month, year) and optionally by customer ID. This is useful for scenarios where you want to analyze or display scheduled or published posts within specific time frames or for particular customers.
Practical examples include:
- Fetching all posts scheduled for a given week to generate reports.
- Retrieving posts for a specific day to display on a dashboard.
- Filtering posts by customer to monitor activity per client.
Properties
| Name | Meaning |
|---|---|
| Week | Week number (1-52) to filter posts by week. |
| Day | Day number (0-6) to filter posts by day, where 0 represents Sunday. |
| Display | Display mode for posts; options are: Day, Week, Month. |
| Month | Month number (1-12) to filter posts by month. |
| Year | Year (2022-2035) to filter posts by year. |
| Customer | Optional customer ID string to filter posts belonging to a specific customer. |
Output
The output is a JSON array containing the list of posts retrieved from the Postiz API based on the specified filters. Each item in the array represents a post object with its associated data as returned by the API. The exact structure depends on the API response but typically includes post details such as content, scheduling information, tags, and integration/channel info.
No binary data is output for this operation.
Dependencies
- Requires an API key credential for authenticating requests to the Postiz API.
- Uses the
form-datapackage internally for file uploads (not relevant for "Get Posts"). - The node relies on a helper function (
postizApiRequest) to make HTTP requests to the Postiz API endpoints.
Troubleshooting
Common issues:
- Invalid or missing API credentials will cause authentication failures.
- Providing out-of-range values for week (not between 1-52), day (not between 0-6), month (not between 1-12), or year (outside allowed range) may result in errors or empty responses.
- Incorrect customer IDs may lead to no posts being returned.
Error messages:
- Errors from the API are caught and returned as JSON objects with an
errorfield describing the issue. - Network or request errors will be logged to the console and included in the output as error messages.
- Errors from the API are caught and returned as JSON objects with an
Resolution tips:
- Verify that the API key credential is correctly configured.
- Ensure input parameters are within valid ranges.
- Check the customer ID for correctness if filtering by customer.
Links and References
- Postiz API Documentation (Assumed URL, replace with actual if known)
- n8n documentation on Creating Custom Nodes
