初始化项目导入并检查重复项目
curl --request POST \
--url https://bptest.mapleai.cc/api/project-imports/init \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>"
}
'import requests
url = "https://bptest.mapleai.cc/api/project-imports/init"
payload = {
"fileName": "<string>",
"fileSize": 123,
"md5": "<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>'})
};
fetch('https://bptest.mapleai.cc/api/project-imports/init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 0,
"message": "已找到相同 BP 对应的项目",
"data": {
"decision": "REUSE_PROJECT",
"fileMd5": "507e5bcffa043764bffeff67d4e5b595",
"sourceFile": {
"fileId": "source-file-uuid-or-null",
"fileName": "demo.pdf",
"fileSize": 2097736,
"md5": "507e5bcffa043764bffeff67d4e5b595"
},
"recommendedProjectId": "project-uuid",
"projects": [
{
"projectId": "project-uuid",
"latestActureRunId": "n1-run-uuid-or-null",
"latestActureRunStatus": "SUCCEEDED",
"latestSucceededActureRunId": "n1-run-uuid-or-null",
"latestSucceededActureRunStatus": "SUCCEEDED"
}
]
}
}项目导入 / Project Imports
初始化项目导入并检查重复项目
根据当前租户和 PDF MD5 检查重复项目,并决定是否需要上传文件。
data.decision=REUSE_PROJECT:已找到相同 PDF 对应的有效项目。调用方应停止上传并使用data.recommendedProjectId。data.projects包含全部候选及其最近 N1 状态。data.decision=UPLOAD_REQUIRED:未找到重复项目。调用方按data.backend和上传会话信息上传文件。
重复判断限定在当前租户,依据是文件内容 MD5。它不会识别同一企业的不同版本 PDF。forceCreateProject 默认并建议保持为 false。
POST
/
api
/
project-imports
/
init
初始化项目导入并检查重复项目
curl --request POST \
--url https://bptest.mapleai.cc/api/project-imports/init \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"fileName": "<string>",
"fileSize": 123,
"md5": "<string>"
}
'import requests
url = "https://bptest.mapleai.cc/api/project-imports/init"
payload = {
"fileName": "<string>",
"fileSize": 123,
"md5": "<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>'})
};
fetch('https://bptest.mapleai.cc/api/project-imports/init', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"code": 0,
"message": "已找到相同 BP 对应的项目",
"data": {
"decision": "REUSE_PROJECT",
"fileMd5": "507e5bcffa043764bffeff67d4e5b595",
"sourceFile": {
"fileId": "source-file-uuid-or-null",
"fileName": "demo.pdf",
"fileSize": 2097736,
"md5": "507e5bcffa043764bffeff67d4e5b595"
},
"recommendedProjectId": "project-uuid",
"projects": [
{
"projectId": "project-uuid",
"latestActureRunId": "n1-run-uuid-or-null",
"latestActureRunStatus": "SUCCEEDED",
"latestSucceededActureRunId": "n1-run-uuid-or-null",
"latestSucceededActureRunStatus": "SUCCEEDED"
}
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json