tq share icon

tq share

天启数据

Overview

This node interacts with a third-party SMS service API to perform various operations related to phone numbers and verification codes. Specifically, the "获取验证码" (Get Verification Code) operation allows users to request an SMS verification code sent to a specified phone number via a given channel ID. It supports automatic retrying of the request until a code is received or a maximum number of attempts is reached. Additionally, it can automatically blacklist a phone number if the verification code cannot be obtained after repeated tries.

Common scenarios for this node include:

  • Automating the retrieval of SMS verification codes during user registration or login processes.
  • Bulk or repeated requests for verification codes with controlled retry logic.
  • Managing phone numbers by blacklisting those that fail to provide verification codes.

Practical example:

  • A workflow that needs to verify multiple phone numbers by requesting SMS codes and processing them automatically, retrying as needed, and blacklisting unresponsive numbers to avoid further attempts.

Properties

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

Output

The node outputs an array of JSON objects, each representing the result of the operation for one input item. For the "获取验证码" operation, the output JSON includes fields such as:

  • modle (likely a typo for "model" or a status indicator): Indicates whether a verification code was successfully retrieved.
  • message: Contains status messages, including a message indicating if the phone number has been blacklisted ("已拉黑").
  • Other data fields returned from the API related to the verification code request.

If binary data were involved, it would typically represent media content, but this node focuses on JSON responses from the SMS API.

Dependencies

  • Requires an API key credential for authenticating with the external SMS service at https://api.tqsms.xyz/api.
  • The node uses HTTP requests to interact with the SMS service endpoints.
  • No additional environment variables are explicitly required beyond the API authentication token.

Troubleshooting

  • Common issues:

    • Invalid or expired API token leading to authentication failures.
    • Incorrect channel ID or phone number format causing API errors.
    • Network connectivity problems preventing HTTP requests.
    • Exceeding retry limits without receiving a verification code.
  • Error messages and resolutions:

    • Errors returned from the API will be propagated unless "Continue On Fail" is enabled.
    • If the node fails to retrieve a verification code after all retries, and auto-blacklist is enabled, the phone number will be blacklisted automatically.
    • To resolve authentication errors, verify the API key credential configuration.
    • For rate limiting or quota errors, check the SMS service account limits.

Links and References

Discussion