List Assets
GET/v1/assets
需要 API Key成功 200
参数
| 名称 | 类型 | 说明 |
|---|---|---|
limitquery | integer | 默认 50; 范围 1–200 |
cursorquery | string | 长度 ≤ 256; 可为 null |
afterquery | string | 长度 ≤ 256; 可为 null |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
data必填 | array<object> | |
data[].id必填 | string | |
data[].project_id必填 | string | 可为 null |
data[].filename必填 | string | |
data[].bytes必填 | integer | |
data[].sha256必填 | string | |
data[].created_at必填 | number | |
next_cursor | string | Opaque; pass as cursor (or the after alias) for the next page; 可为 null |
has_more | boolean | 默认 false |
示例
curl "https://axiomlab.online/v1/assets" \ -H "Authorization: Bearer $AZIMO_API_KEY"
Upload Asset
POST/v1/assets
需要 API Key成功 201
参数
| 名称 | 类型 | 说明 |
|---|---|---|
Idempotency-Keyheader | string | 调用方生成并保存的唯一值;超时重试时复用它,同一请求不会被执行两次; 长度 1–128; 可为 null |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
请求体 multipart/form-data
| 名称 | 类型 | 说明 |
|---|---|---|
file必填 | file |
返回 201 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
project_id必填 | string | 可为 null |
filename必填 | string | |
bytes必填 | integer | |
sha256必填 | string | |
created_at必填 | number |
示例
curl -X POST "https://axiomlab.online/v1/assets" \ -H "Authorization: Bearer $AZIMO_API_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -F "file=@deck.pdf"
Get Asset
GET/v1/assets/{asset_id}
需要 API Key成功 200
参数
| 名称 | 类型 | 说明 |
|---|---|---|
asset_id必填path | string | |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
project_id必填 | string | 可为 null |
filename必填 | string | |
bytes必填 | integer | |
sha256必填 | string | |
created_at必填 | number |
示例
curl "https://axiomlab.online/v1/assets/<asset_id>" \ -H "Authorization: Bearer $AZIMO_API_KEY"
Delete Asset
DELETE/v1/assets/{asset_id}
需要 API Key成功 200
Remove an upload and its bytes. Jobs that already consumed it keep their own copies.
参数
| 名称 | 类型 | 说明 |
|---|---|---|
asset_id必填path | string | |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/json
| 名称 | 类型 | 说明 |
|---|---|---|
id必填 | string | |
deleted | boolean | 默认 true |
示例
curl -X DELETE "https://axiomlab.online/v1/assets/<asset_id>" \ -H "Authorization: Bearer $AZIMO_API_KEY"
Download Asset
GET/v1/assets/{asset_id}/file
需要 API Key成功 200
参数
| 名称 | 类型 | 说明 |
|---|---|---|
asset_id必填path | string | |
X-Project-IDheader | string | 要操作的项目;省略时使用默认项目; 可为 null |
返回 200 application/octet-stream
返回文件内容。
示例
curl "https://axiomlab.online/v1/assets/<asset_id>/file" \ -H "Authorization: Bearer $AZIMO_API_KEY"