SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node interacts with the SparkBot WhatsApp API to manage chat contacts, specifically allowing you to upsert (update or insert) metadata for a contact associated with a WhatsApp number. This is useful when you want to enrich contact information dynamically by adding custom key-value metadata pairs that can be used for segmentation, personalization, or integration with other systems.

Common scenarios:

  • Adding tags or labels to contacts based on their behavior or status.
  • Storing additional identifiers or notes about a contact for later use.
  • Synchronizing contact metadata from external CRM or databases into WhatsApp contacts.

Practical example:
You have a WhatsApp number connected and want to add metadata such as "customer_type": "premium" or "last_purchase_date": "2024-05-01" to a specific contact identified by their WhatsApp contact ID. Using this node operation, you can upsert these metadata fields so they are stored and accessible via the SparkBot API.


Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number to which the contact belongs. This identifies the device/account.
Contact ID The unique identifier of the contact in WhatsApp format (e.g., 447362053576@c.us).
Metadata One or more key-value pairs representing metadata to upsert for the contact. Keys must be alphanumeric or underscores; values can be up to 300 characters.

Output

The node outputs JSON data representing the result of the upsert operation. This typically includes confirmation of the updated metadata or the updated contact object as returned by the SparkBot API.

No binary data output is involved in this operation.


Dependencies

  • Requires an API key credential for authenticating with the SparkBot WhatsApp API.
  • The node depends on the SparkBot service being accessible and properly configured with the WhatsApp numbers and contacts.
  • The property "WhatsApp Number" uses a dynamic load options method to fetch available devices/numbers from the API.

Troubleshooting

  • Common issues:

    • Invalid or missing WhatsApp Number ID: Ensure the selected WhatsApp number exists and is correctly loaded.
    • Incorrect Contact ID format: Must follow WhatsApp contact ID conventions (e.g., including domain like @c.us).
    • Metadata keys with invalid characters or empty keys/values may cause errors.
    • API authentication failures due to invalid or expired API key credentials.
  • Error messages:

    • Errors related to authorization usually indicate problems with the API key credential setup.
    • Validation errors on metadata keys or values will require correcting the input to meet the specified constraints.
    • Network or connectivity errors suggest checking the SparkBot API availability and your network connection.

Links and References


If you need further details on other operations or resources, feel free to ask!

Discussion