Loading...
Loading...
Compare original and translation side by side
sessionTypecreative_projectsessionsessionTypecreative_projectsessionAuthorization: Bearer $SPUREE_ACCESS_TOKENX-API-Key: $SPUREE_API_KEYAuthorization: Bearer $SPUREE_ACCESS_TOKENX-API-Key: $SPUREE_API_KEY| Base URL | Endpoints |
|---|---|
| File CRUD |
| Cross-project search |
| 基础URL | 端点 |
|---|---|
| 文件CRUD操作 |
| 跨项目搜索 |
| Parameter | Type | Default | Description |
|---|---|---|---|
| string | — | Search query (1–255 chars) |
| string | — | Filter: |
| string | — | Restrict results to a specific workspace |
| integer | 100 | Max results (1–100) |
{ "data": [...], "count": N }type"file""session"idnamesessionTypeworkspaceIdcreatedAtupdatedAtidfileNamefileFormatmimeTypesizeworkspaceIdsessionIdentitySessionIdcreatedAtupdatedAtcurl "https://data.spuree.com/api/v1/search?q=hero" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| string | — | 搜索关键词(1–255字符) |
| string | — | 过滤条件: |
| string | — | 将结果限制在指定工作区 |
| integer | 100 | 最大返回结果数(1–100) |
{ "data": [...], "count": N }type"file""session"idnamesessionTypeworkspaceIdcreatedAtupdatedAtidfileNamefileFormatmimeTypesizeworkspaceIdsessionIdentitySessionIdcreatedAtupdatedAtcurl "https://data.spuree.com/api/v1/search?q=hero" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ "data": { id, fileName, fileFormat, mimeType, size, workspaceId, sessionId, entitySessionId, downloadUrl, createdAt, updatedAt } }curl "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ "data": { id, fileName, fileFormat, mimeType, size, workspaceId, sessionId, entitySessionId, downloadUrl, createdAt, updatedAt } }curl "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"mode: "single"mode: "multipart"POST /v1/files/{fileId}/upload/complete| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | File name without extension |
| string | Yes | Extension in lowercase (e.g., |
| integer | Yes | File size in bytes (accepts string for backward compat) |
| string | Yes | Target project or folder ObjectId |
| string | No | CRC32 base64 (8 chars) for end-to-end verification. When provided, the presigned URL is signed with the checksum and S3 verifies the upload matches. |
{ messageCode, fileId, mode: "single", uploadUrl, checksumBase64, contentType }{ messageCode, fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }| Code | Description |
|---|---|
| 200 | Record created, presigned URL(s) returned |
| 404 | Session not found |
| 409 | File already exists |
curl -X POST "https://data.spuree.com/api/v1/files" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileName":"hero_walk","fileFormat":"fbx","fileSize":5242880,"sessionId":"...","checksum":"AAAAAA=="}'mode: "single"mode: "multipart"POST /v1/files/{fileId}/upload/complete| 字段 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 不含扩展名的文件名 |
| string | 是 | 小写格式的扩展名(如 |
| integer | 是 | 文件大小(字节,为兼容旧版本也接受字符串类型) |
| string | 是 | 目标项目或文件夹的ObjectId |
| string | 否 | CRC32 base64格式(8字符),用于端到端验证。提供该值时,预签名URL会附带校验和,S3将验证上传内容是否匹配。 |
{ messageCode, fileId, mode: "single", uploadUrl, checksumBase64, contentType }{ messageCode, fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }| 状态码 | 描述 |
|---|---|
| 200 | 文件记录创建成功,返回预签名URL |
| 404 | 目标session不存在 |
| 409 | 文件已存在 |
curl -X POST "https://data.spuree.com/api/v1/files" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileName":"hero_walk","fileFormat":"fbx","fileSize":5242880,"sessionId":"...","checksum":"AAAAAA=="}'uploadIdListPartsCompleteMultipartUpload| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | Must match path parameter |
| string | No | Client-computed CRC32 for end-to-end verification |
{ messageCode, fileId, checksum, checksumCRC32 }checksumchecksumCRC32curl -X POST "https://data.spuree.com/api/v1/files/{fileId}/upload/complete" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileId": "..."}'uploadIdListPartsCompleteMultipartUpload| 字段 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 必须与路径参数中的fileId一致 |
| string | 否 | 客户端计算的CRC32值,用于端到端验证 |
{ messageCode, fileId, checksum, checksumCRC32 }checksumchecksumCRC32curl -X POST "https://data.spuree.com/api/v1/files/{fileId}/upload/complete" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileId": "..."}'| Field | Type | Description |
|---|---|---|
| string | New name (without extension) |
| string | New extension (lowercase) |
| string | CRC32 base64 (write-once backfill, no edit permission needed) |
| string | Move to target project or folder |
creative_projectsession{ messageCode, fileId }| Code | Description |
|---|---|
| 200 | Updated |
| 409 | Filename conflict in target |
curl -X PATCH "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileName": "hero_run_cycle"}'| 字段 | 类型 | 描述 |
|---|---|---|
| string | 新文件名(不含扩展名) |
| string | 新扩展名(小写) |
| string | CRC32 base64格式(仅可一次性补填,无需编辑权限) |
| string | 将文件移动至目标项目或文件夹 |
creative_projectsession{ messageCode, fileId }| 状态码 | 描述 |
|---|---|
| 200 | 更新成功 |
| 409 | 目标位置存在同名文件 |
curl -X PATCH "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"fileName": "hero_run_cycle"}'POST /v1/filesfileSize| Field | Type | Required | Description |
|---|---|---|---|
| string | Yes | CRC32 base64 of current content (for conflict detection) |
| string | Yes | CRC32 base64 of new content to upload |
| integer | No | Size in bytes. If ≥ 100 MB, returns multipart mode. |
{ messageCode, fileId, mode: "single", uploadUrl, checksumBase64, contentType }{ messageCode, fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }POST /v1/files/{fileId}/upload/complete| Code | Description |
|---|---|
| 200 | Lock acquired, presigned URL(s) returned |
| 409 | Checksum mismatch or locked by another user |
curl -X PUT "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"expectedChecksum": "a1b2...","newChecksum": "f6e5..."}'POST /v1/filesfileSize| 字段 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 是 | 当前文件内容的CRC32 base64值(用于冲突检测) |
| string | 是 | 待上传新内容的CRC32 base64值 |
| integer | 否 | 文件大小(字节)。若大于等于100 MB,返回分块模式 |
{ messageCode, fileId, mode: "single", uploadUrl, checksumBase64, contentType }{ messageCode, fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }POST /v1/files/{fileId}/upload/complete| 状态码 | 描述 |
|---|---|
| 200 | 获取锁成功,返回预签名URL |
| 409 | 校验和不匹配或文件被其他用户锁定 |
curl -X PUT "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"expectedChecksum": "a1b2...","newChecksum": "f6e5..."}'| Parameter | Type | Required | Description |
|---|---|---|---|
| string | No | Client's expected uploadId for mismatch detection |
| string | No | Client's expected pendingChecksum for conflict detection |
{ messageCode, fileId, completedParts: [{partNumber, etag, size}, ...], remainingParts: [{partNumber, startByte, endByte, url}, ...], totalParts }| Code | Description |
|---|---|
| 200 | Success |
| 400 | No active multipart upload |
| 409 | Not in pending status or locked by another user |
curl "https://data.spuree.com/api/v1/files/{fileId}/upload" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"| 参数 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| string | 否 | 客户端预期的uploadId,用于检测不匹配情况 |
| string | 否 | 客户端预期的pendingChecksum,用于冲突检测 |
{ messageCode, fileId, completedParts: [{partNumber, etag, size}, ...], remainingParts: [{partNumber, startByte, endByte, url}, ...], totalParts }| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 无活跃的分块上传任务 |
| 409 | 文件未处于待处理状态或被其他用户锁定 |
curl "https://data.spuree.com/api/v1/files/{fileId}/upload" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ "partNumbers": [1, 3, 5] }{ messageCode, urls: [{partNumber, startByte, endByte, url}, ...] }| Code | Description |
|---|---|
| 200 | Success |
| 400 | No active multipart upload or invalid part numbers |
curl -X POST "https://data.spuree.com/api/v1/files/{fileId}/upload/urls" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"partNumbers": [1, 3, 5]}'{ "partNumbers": [1, 3, 5] }{ messageCode, urls: [{partNumber, startByte, endByte, url}, ...] }| 状态码 | 描述 |
|---|---|
| 200 | 操作成功 |
| 400 | 无活跃的分块上传任务或分块编号无效 |
curl -X POST "https://data.spuree.com/api/v1/files/{fileId}/upload/urls" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"partNumbers": [1, 3, 5]}'{ messageCode, fileId, message }| Code | Description |
|---|---|
| 200 | Aborted |
| 400 | No active multipart upload |
curl -X DELETE "https://data.spuree.com/api/v1/files/{fileId}/upload" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ messageCode, fileId, message }| 状态码 | 描述 |
|---|---|
| 200 | 终止成功 |
| 400 | 无活跃的分块上传任务 |
curl -X DELETE "https://data.spuree.com/api/v1/files/{fileId}/upload" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ messageCode, fileId }curl -X DELETE "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"{ messageCode, fileId }curl -X DELETE "https://data.spuree.com/api/v1/files/{fileId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"CHECKSUM=$(python3 -c "import base64, zlib, sys; print(base64.b64encode(zlib.crc32(open('$FILE_PATH','rb').read()).to_bytes(4,'big')).decode())")sessionIdPOST /v1/files { fileName, fileFormat, fileSize, sessionId, checksum }
→ { fileId, mode: "single", uploadUrl, checksumBase64, contentType }PUT {uploadUrl}
Content-Type: {contentType}
x-amz-checksum-crc32: {checksumBase64}
Body: <file binary>POST /v1/files/{fileId}/upload/completeImportant: All three steps (create → S3 upload → complete) must be performed. Skipping complete leaves the file in a pending state.
CHECKSUM=$(python3 -c "import base64, zlib, sys; print(base64.b64encode(zlib.crc32(open('$FILE_PATH','rb').read()).to_bytes(4,'big')).decode())")sessionIdPOST /v1/files { fileName, fileFormat, fileSize, sessionId, checksum }
→ { fileId, mode: "single", uploadUrl, checksumBase64, contentType }PUT {uploadUrl}
Content-Type: {contentType}
x-amz-checksum-crc32: {checksumBase64}
Body: <文件二进制内容>POST /v1/files/{fileId}/upload/complete重要提示: 必须完成三个步骤(创建→S3上传→完成)。跳过完成步骤会导致文件处于待处理状态。
fileSizePOST /v1/files { fileName, fileFormat, fileSize, sessionId, checksum }
→ { fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }PUT {part.url}
Content-Length: {part.endByte - part.startByte + 1}
Body: <file slice from startByte to endByte>GET /v1/files/{fileId}/uploadPOST /v1/files/{fileId}/upload/urlsCompleteMultipartUploadPOST /v1/files/{fileId}/upload/completeDELETE /v1/files/{fileId}/uploadfileSizePOST /v1/files { fileName, fileFormat, fileSize, sessionId, checksum }
→ { fileId, mode: "multipart", parts: [{partNumber, startByte, endByte, url}, ...], totalParts, expiresAt }PUT {part.url}
Content-Length: {part.endByte - part.startByte + 1}
Body: <文件切片内容,从startByte到endByte>GET /v1/files/{fileId}/uploadPOST /v1/files/{fileId}/upload/urlsCompleteMultipartUploadPOST /v1/files/{fileId}/upload/completeDELETE /v1/files/{fileId}/uploadPUT /v1/files/{fileId}fileSizePOST /v1/files/{fileId}/upload/completePUT /v1/files/{fileId}fileSizePOST /v1/files/{fileId}/upload/completenavigate_page → https://studio.spuree.com/file/{fileId}https://studio.spuree.com/file/{fileId}| Use case | URL | Properties |
|---|---|---|
| Share with user / preview | | Permanent, permission-aware, renders preview UI |
| Programmatic download | | Short-lived presigned S3 URL — do not share, bypasses permissions and expires |
POST /v1/filesGET /v1/searchfileIddownloadUrlnavigate_page → https://studio.spuree.com/file/{fileId}https://studio.spuree.com/file/{fileId}| 使用场景 | URL | 属性 |
|---|---|---|
| 分享给用户/预览 | | 永久链接,权限可控,提供预览UI |
| 程序化下载 | 从 | 短期有效的S3预签名URL——请勿分享,会绕过权限验证且过期失效 |
POST /v1/filesGET /v1/searchfileIddownloadUrlGET /v1/search?q=hero_walkGET /v1/files/{fileId}downloadUrlGET /v1/search?q=hero_walkGET /v1/files/{fileId}downloadUrlsessionIdcreative_projectsessionworks_{workspaceId}/sess_{sessionId}/file_{fileId}sessionIdcreative_projectsessionworks_{workspaceId}/sess_{sessionId}/file_{fileId}| Resource | URL Pattern |
|---|---|
| Project | |
| Folder (top-level) | |
| Folder (nested) | |
| File | |
| 资源 | URL格式 |
|---|---|
| 项目 | |
| 文件夹(顶层) | |
| 文件夹(嵌套) | |
| 文件 | |
| Code | Cause | Resolution |
|---|---|---|
| 400 | Invalid checksum format, missing fields, bad ID | Fix input format |
| 403 | No workspace access or edit permission | Check permissions |
| 404 | File or session not found | Verify IDs |
| 409 (checksum mismatch) | File modified by another user | Re-fetch checksum, retry |
| 409 (upload lock) | Another user is uploading | Wait (lock expires in 1 hour for single, 6 hours for multipart) |
| 409 (filename conflict) | Same name exists in target | Use different name or target |
| 401 | Invalid or expired token | Refresh via authentication skill |
| 状态码 | 原因 | 解决方案 |
|---|---|---|
| 400 | 校验和格式无效、字段缺失、ID错误 | 修正输入格式 |
| 403 | 无工作区访问权限或编辑权限 | 检查权限设置 |
| 404 | 文件或session不存在 | 验证ID正确性 |
| 409(校验和不匹配) | 文件被其他用户修改 | 重新获取校验和后重试 |
| 409(上传锁) | 文件被其他用户锁定上传 | 等待(单文件上传锁1小时后过期,分块上传锁6小时后过期) |
| 409(文件名冲突) | 目标位置存在同名文件 | 使用其他文件名或更换目标位置 |
| 401 | Token无效或过期 | 通过身份验证Skill刷新Token |