资料站支持工单(无鉴权公开面;CORS 白名单 origin):体 {subject 1–120, body 1–4000, email?(形校验), page? ≤200, locale? zh-CN|en|ja|ko, website?(蜜罐:非空 → 202 假成功零动作)} → 经 SMTP 投递到 TANSR_API_SUPPORT_MAILBOX(主题 [tansr 支持] <subject> (<ticketId>);正文 ticketId / locale / page / email(若填)/ 正文,恒不含 IP)+ 审计 support.ticket_received → 202 {ok:true, ticketId: tk_<ulid>};路由级限流每 IP 5 / h(429);SMTP 未配置 503 auth_channel_undelivered(不落库不假成功)
POST
/v1/support/tickets
const url = 'https://api.tansr.com/v1/support/tickets';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"subject":"example","body":"example","email":"hello@example.com","page":"example","locale":"zh-CN","website":"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/support/tickets \ --header 'Content-Type: application/json' \ --data '{ "subject": "example", "body": "example", "email": "hello@example.com", "page": "example", "locale": "zh-CN", "website": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”已受理(蜜罐命中亦同形)
Media typeapplication/json
object
ok
required
boolean
ticketId
required
Tk_ + ulid(邮件主题同携;蜜罐命中亦回形同 id)
string
Example
{ "ok": true}Bad_request(subject / body 长度、email 形、page 长度、locale 词表外、未知键)
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" }}Rate_limited(路由级每 IP 5 / h;Retry-After)
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" }}Auth_channel_undelivered(SMTP 未配置:TANSR_API_SMTP_* 未设;既有码,外投渠道未交割语义)
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" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。