WaliChat icon

WaliChat

Interact with WaliChat WhatsApp API

Actions148

Campaigns → Get Campaigns

AI-generated

Overview

The "Get Campaigns" operation of the Campaigns resource in this node allows users to retrieve a list of WhatsApp campaigns from the WaliChat API. It supports filtering campaigns based on 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 beneficial for users who want to monitor, analyze, or manage their WhatsApp marketing or communication campaigns programmatically within an n8n workflow. For example, a marketing team could use this node to fetch all completed campaigns created after a certain date to generate reports or trigger follow-up actions.

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 associated with the campaigns.
- Owner User IDs Filter by one or more owner user IDs who created or own the campaigns.
- Campaign IDs Filter by one or more specific campaign IDs.
- Phone Numbers Filter campaigns by recipient phone numbers (e.g., +447362053576). Multiple values allowed.
- Group IDs Filter campaigns by recipient group chats (e.g., 44736205357600000000@g.us). Multiple values allowed.
- Results Page Size Number of results per page (pagination size). Default is 20.
- Page Number Page number to retrieve, starting from 0. Used for pagination.
- Sort Sort order for results. Options are "Recent First" (date descending) or "Oldest First" (date ascending). Default is "Recent First".

Output

The output of this operation is a JSON array where each item represents a campaign matching the specified filters. Each campaign object typically contains details such as campaign ID, status, creation date, associated device and owner IDs, recipient information, and other metadata related to the campaign.

If the node supports binary data output for this operation (not indicated explicitly in the provided code), it would typically represent media or files associated with campaigns, but here the focus is on JSON data representing campaign records.

Dependencies

  • Requires an active connection to the WaliChat WhatsApp API via an API key credential configured in n8n.
  • The node depends on the internal campaigns action module that handles the actual API calls to fetch campaign data.
  • No additional external services or environment variables are explicitly required beyond the API key credential.

Troubleshooting

  • Common Issues:

    • Incorrect or missing API key credential will cause authentication failures.
    • Providing invalid filter values (e.g., malformed dates or unsupported status strings) may result in errors or empty results.
    • Pagination parameters out of range might return no data or errors.
  • Error Messages:

    • Errors returned from the API will be surfaced as error messages in the node output if "Continue On Fail" is enabled.
    • Typical errors include authentication errors, invalid parameter errors, or network connectivity issues.
  • Resolution Tips:

    • Verify the API key credential is correctly set up and has necessary permissions.
    • Double-check filter values for correct formats and valid options.
    • Use smaller page sizes or adjust page numbers to ensure valid pagination.
    • Enable "Continue On Fail" to handle partial failures gracefully in workflows.

Links and References

Discussion