Retrieve event subscription
Code Mode: praxis.events.subscriptions.retrieve
HTTP: GET /events/v1/subscriptions/{subscription_id}
Read one subscription to check its filters, its sink and when it expires. Take the id from subscriptions.create or subscriptions.list. A subscription that does not exist, has expired, belongs to someone else or to another organization answers the same 404 SUBSCRIPTION_NOT_FOUND. Read-only.
签名
praxis.events.subscriptions.retrieve(args:{path:{/** e.g. "esub_0123456789abcdef0123456789abcdef" */ subscription_id:string}}):Promise<{/** The subscription id, esub_...; use it to retrieve or delete it. */ id:string;/** The tenant event types it listens to. */ types:Array<string>;/** The conditions that must all hold; empty means every event of the types. */ filters:Array<{/** The attribute equals the value, for example { subject: "runs/run_1" } or { "data.status": "faulted" }. */ exact?:{[key:string]:string};/** The attribute starts with the value, for example { subject: "runs/" }. */ prefix?:{[key:string]:string}}>;/** The inbox address the letters go to, agent:<id> or human:<id>. */ sink:string;/** Whether the subscription ends after its first letter. */ once:boolean;/** When the subscription ends and stops matching, RFC 3339. */ expires_at:string;/** When the subscription was created, RFC 3339. */ created_at:string;/** The address that created it, agent:<id> or human:<id>; only that caller can see it. */ created_by:string}>;参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
| subscription_id | path | string | 是 | Subscription id returned by subscriptions.create or subscriptions.list, in the form esub_ followed by letters and digits. |
响应
| 状态码 | 内容类型 | 说明 |
|---|---|---|
| 200 | application/json | The subscription. |
| 401 | application/problem+json | UNAUTHENTICATED means the credential is missing or invalid; send a valid Praxis credential of your organization. |
| 404 | application/problem+json | SUBSCRIPTION_NOT_FOUND means no live subscription with this id belongs to you; it was deleted, it expired, a once subscription fired, or it is someone else’s. List subscriptions to find an id you can reach. |
| 503 | application/problem+json | PROVIDER_UNAVAILABLE with retryable true means the event catalog or the inbox service cannot answer right now; wait a few seconds and repeat the same call. |