手机短信 OTP 下发(阿里云 dysms:大陆号归一校验 → 四级限频[重发冷却→每号小时→每号日→每 IP 分钟,阈值恒平台配置 sms_settings 驱动,超限 429 otp_rate_limited 携 retryAfterSec] → 6 位码哈希入 Redis[TTL 配置驱动] → 按注册态选模板真发[新号=注册模板/已绑号=登录模板,响应恒同形不泄露注册态];通道未交割或平台配置缺席 503 auth_channel_undelivered;上游拒绝恒不透传细节,上游频控如实 429、余 502 upstream_error)
POST
/v1/auth/sms/request
const url = 'https://api.tansr.com/v1/auth/sms/request';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"phone":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tansr.com/v1/auth/sms/request \ --header 'Content-Type: application/json' \ --data '{ "phone": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
phone
required
大陆手机号(可带 +86/86 前缀与空格,服务端归一)
string
Examplegenerated
{ "phone": "example"}Responses
Section titled “Responses”已下发(存在性不泄露)
Otp_rate_limited(四级限频/上游频控;detail.retryAfterSec)
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}短信通道未交割或平台配置缺席(fail-closed)
Media typeapplication/json
object
error
required
object
code
required
错误码注册表单源派生(src/http/errors.ts ERROR_CODES;码稳定,消费方按码翻译)
string
message
required
string
requestId
required
string
detail
object
Example
{ "error": { "code": "adjudicator_not_authorized" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。