提交项目导入并再次检查重复项目
curl --request POST \
--url https://bptest.mapleai.cc/api/project-imports/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>",
"sessionId": "<string>",
"storage": {
"backend": "<string>",
"objectKey": "<string>",
"etag": "<string>"
}
}
'import requests
url = "https://bptest.mapleai.cc/api/project-imports/commit"
payload = {
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>",
"sessionId": "<string>",
"storage": {
"backend": "<string>",
"objectKey": "<string>",
"etag": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileName: '<string>',
fileSize: 123,
md5: '<string>',
sessionId: '<string>',
storage: {backend: '<string>', objectKey: '<string>', etag: '<string>'}
})
};
fetch('https://bptest.mapleai.cc/api/project-imports/commit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 0,
"message": "项目导入成功",
"data": {
"decision": "PROJECT_CREATED",
"projectId": "project-uuid",
"projectStatus": "UPLOADED",
"idempotentReplay": false
}
}项目导入 / Project Imports
提交项目导入并再次检查重复项目
验证已上传文件并提交项目导入。
data.decision=PROJECT_CREATED:项目创建成功,保存data.projectId。data.decision=REUSE_PROJECT:init 之后有其他请求先完成相同 MD5 的入库。调用方应使用data.recommendedProjectId,不能假定 commit 一定创建新项目。
每个新的业务请求应生成唯一 Idempotency-Key,同一次请求的超时重试必须复用原 key。forceCreateProject=true 会绕过默认重复复用,仅在业务明确需要独立项目时使用。
POST
/
api
/
project-imports
/
commit
提交项目导入并再次检查重复项目
curl --request POST \
--url https://bptest.mapleai.cc/api/project-imports/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>",
"sessionId": "<string>",
"storage": {
"backend": "<string>",
"objectKey": "<string>",
"etag": "<string>"
}
}
'import requests
url = "https://bptest.mapleai.cc/api/project-imports/commit"
payload = {
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>",
"sessionId": "<string>",
"storage": {
"backend": "<string>",
"objectKey": "<string>",
"etag": "<string>"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
fileName: '<string>',
fileSize: 123,
md5: '<string>',
sessionId: '<string>',
storage: {backend: '<string>', objectKey: '<string>', etag: '<string>'}
})
};
fetch('https://bptest.mapleai.cc/api/project-imports/commit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 0,
"message": "项目导入成功",
"data": {
"decision": "PROJECT_CREATED",
"projectId": "project-uuid",
"projectStatus": "UPLOADED",
"idempotentReplay": false
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Show child attributes
Show child attributes
Maximum string length:
100