资料站页面反馈(无鉴权公开面;CORS 白名单 origin docs.tansr.com / localhost:4321):体 {path ^/[a-z0-9\-/]*$ ≤200, helpful boolean(严格), locale? zh-CN|en|ja|ko} → 落 docs_feedback 一行(day = 服务器 UTC 日键;ip_hash = sha256(ip + 日键) 前 16 hex,原 IP 恒不落库)→ 202 {ok:true};路由级限流每 IP 60 / h(429 rate_limited + Retry-After)
POST
/v1/docs/feedback
const url = 'https://api.tansr.com/v1/docs/feedback';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"path":"example","helpful":true,"locale":"zh-CN"}'};
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/docs/feedback \ --header 'Content-Type: application/json' \ --data '{ "path": "example", "helpful": true, "locale": "zh-CN" }'Request Bodyrequired
Section titled “Request Bodyrequired”Responses
Section titled “Responses”已受理
Media typeapplication/json
object
ok
required
boolean
Example
{ "ok": true}Bad_request(path 形制 / helpful 非 boolean / 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 60 / 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" }}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。