跳转到内容
EN

Retrieve share

Code Mode: praxis.share.permissions.retrieve

HTTP: GET /share/v1/permissions/{id}

Read one share to see whether its link is still active, when it expires, and how many times it was opened. Take the id from shares.create or shares.list. The record never includes link.web_url, because the address is shown once at creation. A share that does not exist or belongs to another organization answers 404 PERMISSION_NOT_FOUND.

签名

praxis.share.permissions.retrieve(args:{path:{/** e.g. "shr_0123456789abcdef0123456789abcdef" */ id:string}}):Promise<{/** Share id, shr_ followed by 32 lowercase letters or digits; use it to retrieve or delete the share. */ id:string;/** Object type tag; always share.permission. */ object:"share.permission";/** The organization that owns the share, taken from the credential that created it. */ organization_id:string;resource:{/** What kind of object is shared; file, canvas, media_asset and agent create today. e.g. "file" */ type:"file"|"artifact"|"canvas"|"media_asset"|"agent";/** Id of the object within its type. */ id:string};/** What the link grants; read only. */ roles:Array<"read">;link:{/** What the link allows; view, which is read-only, is the only type. */ type:"view";/** Who can open the link; anonymous, meaning anyone holding it, is the only scope. */ scope:"anonymous";/** Whether the link asks viewers not to download; a limit, not a guarantee. */ prevents_download:boolean;/** The link address to give to people; present only in the creation response, since the service stores a hash of it and cannot show it again. */ web_url?:string};/** ISO 8601 instant after which the link answers 410, or null when it never expires. */ expire_time:string|null;/** Current state of the link; expired is derived from expire_time and revoked comes from delete. */ status:"active"|"expired"|"revoked";/** Who created the share, in the form user:{id}; the user behind the API key or session that made the call. */ created_by:string;/** When the share was created, ISO 8601. */ create_time:string;/** When the share was deleted, ISO 8601, or null while it has not been. */ revoke_time:string|null;/** How many times the link was opened. */ open_count:number;/** When the link was last opened, ISO 8601, or null if it never was. */ last_open_time:string|null}>;

参数

名称位置类型必填说明
idpathstring是Share id returned by shares.create or shares.list, in the form shr_ followed by 32 lowercase letters or digits; a link address is not accepted.

响应

状态码内容类型说明
200application/jsonThe share, without link.web_url.
401application/jsonThe bearer API key is missing or invalid; provide a valid Praxis API key before retrying.
403application/jsonPERMISSION_DENIED means the credential cannot perform this operation, or is bound to specific files and listed without naming one; use a key with share access, or pass resource_type and resource_id of a bound file.
404application/jsonPERMISSION_NOT_FOUND means the share does not exist in this organization, or the credential is not bound to its file; list shares to find an id you can reach.
500application/jsonINTERNAL means the service could not complete the request; for a create, list shares for the file before retrying so the same object is not exposed twice.