Skip to main content
GET
/
api
/
open
/
v2
/
assets
/
{asset_id}
查询工作流资源
curl --request GET \
  --url https://www.chenyu.cn/api/open/v2/assets/{asset_id} \
  --header 'Authorization: Bearer <token>'
{
  "code": 123,
  "msg": "<string>",
  "data": {
    "asset_id": "<string>",
    "asset_uri": "<string>",
    "url": "<string>",
    "signed_url": "<string>",
    "media_type": "<string>",
    "mime_type": "<string>",
    "size_bytes": 123,
    "purpose": "<string>",
    "persistent": true,
    "expires_at": "<string>",
    "status": "<string>"
  }
}

查询工作流资源

根据资源 ID 查询资源状态、引用地址和访问地址。资源过期、无权限或审核未通过时,接口会返回错误信息。

请求参数

asset_id
string
required
资源 ID,例如 asset_38d2ff7769fb3b7267039941547e6a78

响应参数

code
integer
响应码,0 表示成功
msg
string
响应信息
data
object
资源信息

代码示例

import requests

asset_id = "asset_38d2ff7769fb3b7267039941547e6a78"
url = f"https://www.chenyu.cn/api/open/v2/assets/{asset_id}"
headers = {"Authorization": "Bearer your_api_key"}

response = requests.get(url, headers=headers)
print(response.json()["data"]["asset_uri"])

响应示例

{
  "code": 0,
  "msg": "查询成功",
  "data": {
    "asset_id": "asset_38d2ff7769fb3b7267039941547e6a78",
    "asset_uri": "asset://asset_38d2ff7769fb3b7267039941547e6a78",
    "url": "https://www.chenyu.team/assets/asset_38d2ff7769fb3b7267039941547e6a78/content",
    "content_url": "https://www.chenyu.team/assets/asset_38d2ff7769fb3b7267039941547e6a78/content",
    "signed_url": "https://www.chenyu.team/assets/asset_38d2ff7769fb3b7267039941547e6a78/content?expires=1781295600&signature=xxxx",
    "media_type": "image",
    "mime_type": "image/png",
    "size_bytes": 102400,
    "purpose": "temp_input",
    "persistent": false,
    "expires_at": "2026-06-16T12:00:00+08:00",
    "status": "confirmed",
    "original_filename": "input.png"
  }
}