Actions38
- Chatbot Actions
- Contact Actions
- Message Actions
- Panel Actions
- Sequence Actions
- Session Actions
Overview
This node interacts with the WTS Chat API to retrieve and manage contact data. Specifically, the "Get All Contacts" operation fetches a list of contacts from the system, supporting filtering, sorting, pagination, and inclusion of additional details such as tags or custom fields.
Common scenarios where this node is beneficial include:
- Synchronizing contact lists from WTS Chat into other systems.
- Filtering contacts by status or creation/update dates for targeted marketing or support workflows.
- Retrieving enriched contact information including tags and custom fields for detailed processing or reporting.
Practical example:
- A user wants to get all active contacts created after a certain date, sorted by name ascending, including their tags and custom fields, and process them in batches automatically.
Properties
| Name | Meaning |
|---|---|
| Include Details | Choose which additional details to include with each contact. Options: Tags, CustomFields. |
| Status | Filter contacts by their status. Options: Active, Archived, Blocked, Undefined. Default is Active if not specified. |
| CreatedAt.After | Filter contacts created after this date/time (format: YYYY-MM-DD hh:mm, timezone-aware). |
| CreatedAt.Before | Filter contacts created before this date/time. |
| UpdatedAt.After | Filter contacts updated after this date/time. |
| UpdatedAt.Before | Filter contacts updated before this date/time. |
| Auto Pagination | Enable automatic pagination to retrieve multiple pages of results seamlessly. |
| Max Pages | When auto pagination is enabled, limit the maximum number of pages to retrieve (1 to 100). |
| Page Number | When auto pagination is disabled, specify which page number to retrieve. |
| Page Size | When auto pagination is disabled, specify how many contacts to retrieve per page (1 to 100). |
| Order By | Field name to sort the contacts by (e.g., name, createdAt). |
| Order Direction | Direction of sorting. Options: Ascending, Descending. Default is Ascending. |
Output
The node outputs an array of JSON objects representing contacts retrieved from the WTS Chat API. Each object contains the contact's data fields as returned by the API, potentially including:
- Basic contact information (e.g., id, name, email, phone number).
- Additional details if requested via "Include Details" property, such as tags and custom fields.
- Metadata related to creation and update timestamps.
No binary data output is produced by this operation.
Dependencies
- Requires an API key credential for authenticating with the WTS Chat API.
- The node uses the base URL
https://api.wts.chatfor API requests. - Proper configuration of the API key credential within n8n is necessary.
Troubleshooting
- Empty or missing API key: The node will fail if the API key credential is not set or invalid. Ensure the API key is correctly configured.
- Invalid date formats: Date/time filters must be in the format
YYYY-MM-DD hh:mmand respect your time zone. Incorrect formats may cause errors or no results. - Pagination issues: If auto pagination is enabled but max pages is set too low, you might not retrieve all expected contacts.
- Invalid status filter: Using a status value outside the allowed options will result in an error.
- API errors: Network issues or API rate limits can cause failures. Check error messages for details and retry accordingly.
Common error messages thrown by the node include:
- "Invalid email!" when creating contacts with malformed emails (not applicable here but relevant in contact operations).
- "Fill in the field session" or similar messages when required parameters are missing (not directly relevant to this operation).
- Generic API errors wrapped as NodeApiError with details from the WTS Chat API response.
Links and References
- WTS Chat API Documentation (Assumed official docs URL, replace with actual if known)
- n8n Documentation on Creating Custom Nodes
- General info on Pagination in APIs