Overview
This node, named "Social Media Call," enables users to make customizable API calls to social media management platforms. It is designed to facilitate interactions with various social media APIs by allowing flexible HTTP requests with different methods, endpoints, headers, query parameters, and body formats.
Common scenarios where this node is beneficial include:
- Fetching data from social media accounts or posts.
- Creating or updating content on social media platforms.
- Deleting resources such as posts or comments.
- Integrating social media data into workflows for analytics or automation.
Practical examples:
- Retrieving a list of user accounts from a social media platform using a GET request.
- Posting a new message or media item using a POST request with a JSON body.
- Updating profile information with a PUT or PATCH request.
- Deleting a scheduled post via a DELETE request.
Properties
| Name | Meaning |
|---|---|
| HTTP Method | The HTTP method to use for the request. Options: GET, POST, PUT, PATCH, DELETE. |
| Endpoint | The API endpoint path to call (excluding the base URL). For example, /accounts or /posts/123. |
| Send Body | Whether to send a request body. Only applicable for POST, PUT, and PATCH methods. |
| Body Type | The format of the request body when sending one. Options: JSON, Form Data, Raw. |
| Body (JSON) | The JSON-formatted body content to send. Used if Body Type is JSON. |
| Body (Raw) | The raw string body content to send. Used if Body Type is Raw. |
| Body Parameters | Key-value pairs representing form data parameters. Used if Body Type is Form Data. |
| Send Headers | Whether to send custom HTTP headers with the request. |
| Headers | Custom headers as key-value pairs to include in the request. |
| Send Query Parameters | Whether to send query parameters with the request. |
| Query Parameters | Key-value pairs representing query parameters to append to the URL. |
| Response Format | How to format the response data. Options: JSON (parse response as JSON), String (return response as string), Full Response (return full response object including status and headers). |
| Options | Additional request options: • Timeout: Time in milliseconds to wait for server response before aborting. • Ignore SSL Issues: Whether to allow connections with invalid SSL certificates. • Follow Redirects: Whether to follow HTTP redirects. |
Output
The node outputs an array of items corresponding to each input item processed. Each output item contains a json field structured as follows depending on the selected response format:
- JSON: The parsed JSON response from the API call is returned under
json.data. - String: The response is returned as a string under
json.data. - Full Response: The entire response object (including status code, headers, and body) is returned under
json.
If the node encounters an error and "Continue On Fail" is enabled, it outputs an error object with fields:
error: Error message string.statusCode: HTTP status code if available.statusMessage: HTTP status message if available.
The node does not output binary data.
Dependencies
- Requires an API authentication credential configured in n8n for the social media platform's API (referred generically as "an API key credential").
- The base URL for API requests is taken from the credential configuration.
- Uses internal n8n helper methods to perform authenticated HTTP requests.
Troubleshooting
- Invalid JSON in Body: If the JSON body provided is malformed, the node throws an error indicating invalid JSON. To fix, ensure the JSON syntax is correct.
- Timeouts: Requests may fail if the server does not respond within the specified timeout. Increase the timeout option if necessary.
- SSL Certificate Issues: If connecting to an API with an invalid SSL certificate, enable the "Ignore SSL Issues" option to bypass validation.
- Authentication Errors: Ensure that the API credential is correctly configured and has the required permissions.
- Incorrect Endpoint or Method: Verify that the endpoint path and HTTP method are valid for the target API.
- Response Parsing Errors: If the response format is set to JSON but the API returns non-JSON data, parsing may fail silently; consider switching to String or Full Response format.
Links and References
- HTTP Methods
- REST API Concepts
- Working with JSON
- Handling HTTP Headers
- n8n Documentation - HTTP Request Node (for similar usage patterns)