站内通知读面(全员;member 只见本人涉入单):事实源 = approval_outbox;?afterId 增量轮询,cursor 按扫描位推进,未读徽标 = 新到条数
GET
/v1/org-notifications
const url = 'https://api.tansr.com/v1/org-notifications';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tansr.com/v1/org-notifications \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Header Parameters
Section titled “Header Parameters”x-tansr-org
string
Org 作用域声明(org 公开 id);服务端校验成员资格与角色,非成员恒 404、角色不够 403
Query Parameters
Section titled “Query Parameters”afterId
string
上次 cursor(数值串);缺省从头
limit
integer
Responses
Section titled “Responses”通知增量批次
Media typeapplication/json
object
data
required
Array<object>
object
id
required
Outbox 行 id(数值串,单调递增;作 afterId 增量游标)
string
eventType
required
Approval.created / approval.decided / approval.cancelled / approval.expired(开集)
string
occurredAt
required
string
cursor
required
下次轮询 afterId(无新行回显入参;从未有行 null)
string | null
Example
{ "data": [ { "action": "approve" } ]}本文是否有帮助?
感谢反馈,我们会持续改进这篇文章。