WTS Chat icon

WTS Chat

Get data from Wts API

Overview

The Get All Contacts operation for the Contact resource in the WTS Chat n8n node retrieves a list of contacts from the WTS API. This operation is highly configurable, allowing users to filter, sort, and paginate through contacts, as well as include additional details such as tags or custom fields.

Common scenarios:

  • Fetching all active contacts for marketing campaigns.
  • Exporting contact lists with specific statuses (e.g., archived, blocked).
  • Retrieving contacts created or updated within a certain date range.
  • Integrating WTS contacts into other systems via n8n workflows.

Practical examples:

  • Automatically sync new contacts from WTS to a CRM.
  • Generate reports on recently updated contacts.
  • Filter contacts by status and export them to a spreadsheet.

Properties

Below are the supported input properties for this operation, including their display names, types, and meanings:

Display Name Type Meaning
Include Details multiOptions Additional information to include for each contact (e.g., Tags, CustomFields).
Status options Status of contacts to be listed (Active, Archived, Blocked, Undefined). Defaults to Active.
CreatedAt.After dateTime Only include contacts created after this date/time.
CreatedAt.Before dateTime Only include contacts created before this date/time.
UpdatedAt.After dateTime Only include contacts updated after this date/time.
UpdatedAt.Before dateTime Only include contacts updated before this date/time.
Auto Pagination boolean Whether to automatically fetch multiple pages of results.
Max Pages number Maximum number of pages to retrieve (used if Auto Pagination is enabled).
Page Number number The page number to retrieve (used if Auto Pagination is disabled).
Page Size number Number of items per page (used if Auto Pagination is disabled).
Order By string Field to sort the results by.
Order Direction options Sort direction: Ascending or Descending.

Output

The output consists of an array of objects, each representing a contact retrieved from the WTS API. Each object is available under the json field.

Output structure example:

[
  {
    "json": {
      // Contact data as returned by the WTS API
      "id": "string",
      "name": "string",
      "email": "string",
      "phonenumber": "string",
      "status": "ACTIVE",
      "createdAt": "2023-01-01T12:00:00Z",
      "updatedAt": "2023-01-02T12:00:00Z",
      // ...other standard and optional fields
      "tags": [ /* if included */ ],
      "customFields": { /* if included */ }
    }
  }
]
  • The exact fields depend on the WTS API response and the selected "Include Details" options.
  • No binary data is produced by this operation.

Dependencies

  • External Service: Requires access to the WTS API.
  • API Key: You must configure valid WTS API credentials (wtsApi) in n8n.
  • n8n Configuration: Ensure the node has access to the internet and the correct base URL (https://api.wts.chat).

Troubleshooting

Common issues:

  • Invalid API Key: If your credentials are incorrect, the node will throw an authentication error.
  • Missing Required Fields: If required parameters are missing or invalid, you may receive errors from the API.
  • Pagination Limits: Setting very high values for "Max Pages" or "Page Size" may result in long execution times or API rate limits.
  • Date Format Errors: Ensure date/time fields are entered in the correct format (YYYY-MM-DD hh:mm).

Error messages and resolutions:

  • "Invalid API key": Check your WTS API credentials in n8n.
  • "Status code 400/401/403": Review your input parameters and permissions.
  • "Request failed with status code 500": The WTS API may be experiencing issues; try again later or contact support.

Links and References


Discussion