SmClick icon

SmClick

Consume SM Click API

Overview

This node integrates with the SM Click API to send various types of messages and manage contacts via WhatsApp. It supports sending text messages, images, videos, audio files, and generic files, as well as creating new contacts in the SM Click system.

Typical use cases include:

  • Automating customer notifications by sending personalized WhatsApp messages.
  • Sharing multimedia content such as promotional videos or product images directly to customers.
  • Managing contact lists by programmatically adding new contacts with optional tags.

For example, a business could use this node to send a video demonstration of a product to a customer's phone number or add a new contact to their marketing list with specific tags for segmentation.

Properties

Name Meaning
Phone Number The recipient's phone number in international format.
Video (Base64) Base64 encoded video data including the data URI prefix (e.g., data:video/mp4;base64,).
Filename The name of the video file being sent.
Instance ID Identifier for the SM Click instance to be used for sending the message or managing contacts.

Output

The node outputs an array of JSON objects, each representing the result of an operation performed on an input item. Each object includes:

  • success: A boolean indicating if the operation was successful.
  • operation: The type of operation executed (e.g., "sendVideo").
  • Additional fields returned from the SM Click API response, which may include message IDs, status, or other metadata depending on the operation.

No binary data is output by this node; all responses are JSON-formatted.

Dependencies

  • Requires an active SM Click API account with valid credentials (API key and API URL).
  • The node expects these credentials to be configured within n8n as an API key credential.
  • Uses the Axios HTTP client library internally to make REST API calls to SM Click.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Incorrectly formatted phone numbers (not in international format) may lead to message delivery errors.
    • Base64 data must include the correct data URI prefix; otherwise, the node prepends a default prefix but it might not match the actual media type.
    • Sending unsupported operations or missing required parameters will throw errors.
  • Error Messages:

    • Errors from the SM Click API are caught and rethrown with the prefix SM Click API error: followed by the API's error message. This helps identify issues like invalid parameters or quota limits.
    • If the operation specified is not supported, the node throws an error stating that the operation is not supported.
  • Resolution Tips:

    • Verify API credentials and permissions.
    • Ensure phone numbers are correctly formatted.
    • Confirm that base64 strings include proper prefixes or provide them explicitly.
    • Check the SM Click API documentation for valid parameter values and limits.

Links and References

Discussion