SparkBot icon

SparkBot

Interact with SparkBot WhatsApp API

Actions148

Overview

This node operation allows users to bulk create multiple chat contacts in a WhatsApp environment managed via the SparkBot API. It is designed to efficiently add or update up to 1000 contacts at once for a specified WhatsApp number (device). This is particularly useful for businesses or teams that need to import large contact lists into their WhatsApp communication system, enabling streamlined messaging and customer management.

Practical examples include:

  • Importing a customer database into WhatsApp contacts for marketing campaigns.
  • Synchronizing CRM contacts with WhatsApp contacts in bulk.
  • Updating existing contacts' information while adding new ones simultaneously.

Properties

Name Meaning
WhatsApp Number The ID of the WhatsApp number (device) from which the contacts will be managed.
Contacts A list of contacts to create or update in bulk (up to 1000). Each contact includes:
- Phone Number: Contact's phone number in E.164 format (e.g., +447362053576) (required).
- Name: Contact's first name (max 30 characters).
- Surname: Contact's last name (max 50 characters).
- Email: Contact's email address.
- Company: Contact's company name.
Upsert Existing Contacts Boolean flag indicating whether to update existing contacts if they already exist (default: true).

Output

The output is an array of JSON objects representing the result of the bulk create operation. Each object corresponds to the response from the API for each processed contact or the entire batch, depending on implementation details not visible here. The JSON typically contains confirmation of created or updated contacts, including any identifiers or status messages returned by the API.

If binary data were involved (not indicated here), it would represent files or media related to contacts, but this operation focuses solely on JSON contact data.

Dependencies

  • Requires an API key credential for authenticating with the SparkBot WhatsApp API.
  • The node depends on the SparkBot API service being accessible and properly configured.
  • The "WhatsApp Number" property must correspond to a valid device ID registered in the SparkBot system.
  • The node uses internal methods from the bundled chatContacts action module to perform the bulk creation.

Troubleshooting

  • Common Issues:

    • Invalid phone number format: Ensure all phone numbers are in E.164 format (e.g., +123456789).
    • Exceeding contact limit: Bulk creation supports up to 1000 contacts per request; exceeding this may cause errors.
    • Missing required fields: Phone number is mandatory for each contact.
    • Authentication failures: Verify that the API key credential is correctly set and has necessary permissions.
    • Network or API downtime: Check connectivity and SparkBot API status.
  • Error Messages:

    • "Invalid phone number format": Correct the phone numbers to match E.164 standard.
    • "Authentication failed": Recheck API key credentials.
    • "Contact limit exceeded": Reduce the number of contacts in the batch.
    • "Upsert option error": If updating existing contacts fails, verify the upsert flag and contact uniqueness criteria.

Links and References

  • E.164 Phone Number Format
  • SparkBot API documentation (refer to your organization's internal docs or API portal)
  • n8n Documentation on creating custom nodes and using fixed collections for input properties

Discussion