tq share icon

tq share

天启数据

Overview

This node integrates with the Tianqi Data (天启数据) API to perform various operations related to phone number management and verification codes. Specifically, for the "获取验证码" (Get Verification Code) operation, it retrieves SMS verification codes sent to a specified phone number via a given channel ID. It supports an optional retry mechanism that repeatedly attempts to fetch the verification code until successful or until a maximum retry count is reached. Additionally, if retries fail, it can automatically blacklist the phone number to prevent further use.

Common scenarios where this node is beneficial include:

  • Automating the retrieval of SMS verification codes during testing or account creation workflows.
  • Managing phone numbers and their verification status in bulk.
  • Automatically handling failed verification attempts by blacklisting problematic numbers.

Practical example:

  • A user wants to automate sign-up processes requiring SMS verification. They provide the channel ID and phone number, enable retrying, and configure retry count and interval. The node will keep polling for the verification code until it arrives or the retry limit is hit, then output the code or mark the number as blacklisted.

Properties

Name Meaning
渠道ID (channelId) The identifier of the SMS channel through which the verification code is sent.
手机号码 (phoneNum) The target phone number to receive the verification code.
是否循环获取 (for) Boolean flag indicating whether to repeatedly attempt fetching the verification code until success.
循环次数 (num) Maximum number of retry attempts when looping is enabled (minimum 1).
循环间隔 (time) Interval in milliseconds between retry attempts (minimum 1000 ms).
失败自动拉黑 (black) Boolean flag indicating whether to automatically blacklist the phone number if all retries fail.

Output

The node outputs an array of JSON objects, each representing the result of the verification code retrieval attempt for each input item. The main fields in the output JSON include:

  • modle (likely a typo for "model" or a status flag): Indicates whether the verification code was successfully retrieved.
  • message: Contains informational messages such as success confirmation or "已拉黑" ("Blacklisted") if the number was blacklisted after failed retries.
  • Other data fields returned from the API related to the verification code and its metadata.

If the node is configured to retry, the output reflects the final state after all attempts, including any automatic blacklisting.

The node does not output binary data.

Dependencies

  • Requires an API key credential for authenticating requests to the Tianqi Data API (tqShareApi).
  • Makes HTTP requests to the base URL: https://api.tqsms.xyz/api.
  • Uses an internal helper module for retry logic (codeRetry) to handle repeated attempts at fetching the verification code.

Troubleshooting

  • Common issues:

    • Incorrect or missing channel ID or phone number parameters will cause the API request to fail.
    • Network connectivity problems may prevent successful HTTP requests.
    • If retries are enabled but the verification code never arrives, the node may eventually blacklist the phone number if configured to do so.
  • Error messages:

    • API errors will be thrown if authentication fails or parameters are invalid.
    • If the node is set to continue on failure, error codes will be included in the output JSON under an error field.
  • Resolutions:

    • Verify that the API key credential is correctly configured and valid.
    • Ensure the channel ID and phone number are correct and active.
    • Adjust retry count and interval settings to balance between responsiveness and API rate limits.
    • Disable automatic blacklisting if undesired, or monitor blacklisted numbers separately.

Links and References

  • Tianqi Data official API documentation (not provided in source; consult vendor resources)
  • n8n HTTP Request node documentation for understanding underlying request mechanics
  • Retry logic patterns in asynchronous JavaScript (for understanding retry behavior)

Discussion