Actions148
- Chats Actions
- Chat Contacts Actions
- Chat Messages Actions
- Chat Files Actions
- Files Actions
- Team Actions
- Labels Actions
- Departments Actions
- Quick replies Actions
- Queue Actions
- WhatsApp session Actions
- WhatsApp profile Actions
- Business catalog Actions
- Campaigns Actions
- Meeting Links Actions
- User Status Actions
- Webhooks Actions
- Other Actions
- Send messages Actions
- Outbound Messages Actions
- WhatsApp Numbers Actions
- Groups Actions
- Channels Actions
Overview
The "Get Campaigns" operation of the Campaigns resource in this node allows users to retrieve a list of WhatsApp campaigns from the SparkBot API. It supports filtering campaigns by various criteria such as creation date, status, device IDs, owner user IDs, campaign IDs, recipient phone numbers, and group chat IDs. Additionally, it supports pagination and sorting of results.
This operation is useful for scenarios where you want to monitor, analyze, or report on campaigns that have been created or are currently running within your WhatsApp marketing or communication platform. For example, you might want to fetch all completed campaigns from the last month or get campaigns associated with specific devices or owners.
Properties
| Name | Meaning |
|---|---|
| Filters | A collection of filters to narrow down the campaigns retrieved: |
| - Before Date | Filter campaigns created before this date (date-time). |
| - After Date | Filter campaigns created after this date (date-time). |
| - Status | Filter by campaign status. Possible values: Draft, Pending, Processing, Completed, Failed, Stopped, Paused, Incomplete. |
| - Device IDs | Filter by one or more WhatsApp device IDs. |
| - Owner User IDs | Filter by one or more owner user IDs. |
| - Campaign IDs | Filter by one or more campaign IDs. |
| - Phone Numbers | Filter campaigns by one or more recipient phone numbers (e.g., +447362053576). |
| - Group IDs | Filter campaigns by one or more recipient group chat IDs (e.g., 44736205357600000000@g.us). |
| - Results Page Size | Number of results per page (default 20). |
| - Page Number | Page number to retrieve, starting from 0 (default 0). |
| - Sort | Sort order for results. Options: Recent First (date descending), Oldest First (date ascending). |
Output
The output is an array of JSON objects representing campaigns matching the specified filters. Each object contains details about a campaign as returned by the SparkBot API. The exact structure depends on the API response but typically includes fields like campaign ID, status, creation date, associated device and owner IDs, recipients, and other metadata.
No binary data output is indicated for this operation.
Dependencies
- Requires an API key credential for authenticating with the SparkBot WhatsApp API.
- The node relies on the SparkBot API endpoints related to campaigns.
- No additional environment variables or external services beyond the configured API key are required.
Troubleshooting
Common Issues:
- Invalid or missing API key will cause authentication failures.
- Using invalid filter values (e.g., malformed dates or unknown status) may result in errors or empty results.
- Pagination parameters out of range may return no data.
Error Messages:
- Authentication errors: Verify that the API key credential is correctly set up.
- Validation errors: Check that filter inputs conform to expected formats (dates, IDs).
- Network or API errors: Ensure network connectivity and that the SparkBot API service is operational.
Links and References
- SparkBot WhatsApp API Documentation (hypothetical link)
- n8n documentation on Creating Custom Nodes
- General info on WhatsApp campaign management APIs