WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The node "WTS Chat" integrates with the WTS API to manage contacts, messages, sessions, panels, sequences, and chatbots. Specifically for the Contact resource with the Get All Contacts operation, it retrieves a list of contacts from the WTS system based on various filtering, sorting, and pagination options.

This node is beneficial in scenarios where you need to:

  • Fetch all or filtered contacts from your WTS CRM system.
  • Automate workflows that require contact data synchronization or processing.
  • Retrieve contacts with specific statuses or created/updated within certain date ranges.
  • Include additional details such as tags or custom fields for each contact.

Practical examples include:

  • Exporting active contacts created after a certain date for marketing campaigns.
  • Synchronizing contact lists with other systems by fetching paginated contact data.
  • Filtering contacts by status (e.g., only archived contacts) for audit or cleanup tasks.

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 (according to your time zone).
CreatedAt.Before Filter contacts created before this date/time. Format: YYYY-MM-DD hh:mm.
UpdatedAt.After Filter contacts updated after this date/time. Format: YYYY-MM-DD hh:mm.
UpdatedAt.Before Filter contacts updated before this date/time. Format: YYYY-MM-DD hh:mm.
Auto Pagination Enable automatic pagination to fetch multiple pages of contacts automatically.
Max Pages When auto pagination is enabled, set the maximum number of pages to retrieve (1 to 100). Default is 10.
Page Number When auto pagination is disabled, specify the page number to retrieve. Default is 1.
Page Size When auto pagination is disabled, specify the number of contacts per page (1 to 100). Default is 15.
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 output is an array of JSON objects representing contacts retrieved from the WTS API. Each item contains the contact data fields as returned by the API, including any requested additional details like tags or custom fields.

  • The json field holds the contact information.
  • If "Include Details" options are selected, the output will also contain those nested details.
  • No binary data output is produced by this operation.

Example output structure (simplified):

[
  {
    "json": {
      "id": "contact_id_123",
      "name": "John Doe",
      "email": "[email protected]",
      "phonenumber": "+1234567890",
      "status": "ACTIVE",
      "tags": [...],            // Present if Tags included
      "customFields": {...},    // Present if CustomFields included
      "createdAt": "2023-01-01T12:00:00Z",
      "updatedAt": "2023-02-01T12:00:00Z"
    }
  },
  ...
]

Dependencies

  • Requires an API key credential for authenticating with the WTS API.
  • The base URL used is https://api.wts.chat.
  • No additional external dependencies beyond the WTS API and n8n's standard environment.

Troubleshooting

  • Invalid API Key or Authentication Errors: Ensure the API key credential is correctly configured and has sufficient permissions.
  • Empty or Missing Required Parameters: For example, if filters or pagination parameters are invalid or missing, the node may throw errors.
  • Date Format Issues: Date/time inputs must follow the format YYYY-MM-DD hh:mm and respect the user's time zone.
  • Pagination Limits: If auto pagination is enabled but max pages is set too high, the node might take longer to execute or hit API rate limits.
  • API Rate Limits or Network Issues: Temporary failures connecting to the WTS API can cause errors; retry or check network connectivity.
  • Error Messages: The node throws descriptive error messages wrapped as NodeApiError indicating the problem source, e.g., invalid email format when creating contacts or missing required IDs.

Links and References


This summary focuses exclusively on the Contact resource's Get All Contacts operation as requested, based on static analysis of the provided source code and property definitions.

Discussion