项目 Beta
用于组织各类构件的项目。
创建新项目。
POST /project/management
返回根据所提供数据创建的项目。
认证: Bearer 令牌
请求体
要创建的项目对象。
响应
-
200成功。 -
500执行此操作时出错。
curl -X POST https://api.sommatic.ai/project/management \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch('https://api.sommatic.ai/project/management', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/project/management",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={},
)
data = response.json() 响应
{
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": "<ProjectManagement>"
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}更新现有项目。
PATCH /project/management
使用所提供的数据更新现有项目。
认证: Bearer 令牌
请求体
要创建的项目对象。
响应
-
200成功。 -
500执行此操作时出错。
curl -X PATCH https://api.sommatic.ai/project/management \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'const response = await fetch('https://api.sommatic.ai/project/management', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/project/management",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={},
)
data = response.json() 响应
{
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": "<ProjectManagement>"
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}按 ID 删除项目。
DELETE /project/management
根据提供的 ID 删除项目。
认证: Bearer 令牌
请求体
要删除的项目 ID
-
idstring
响应
-
200成功。 -
500执行此操作时出错。
curl -X DELETE https://api.sommatic.ai/project/management \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>"
}'const response = await fetch('https://api.sommatic.ai/project/management', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.delete(
"https://api.sommatic.ai/project/management",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>"
},
)
data = response.json() 响应
{
"status": 200,
"success": true,
"message": "Project successfully deleted",
"result": null
}{
"status": 500,
"success": false,
"message": "Something went wrong while performing this action",
"result": null
}按查询选择器获取项目。
GET /project/management/{queryselector}
返回与路由中指定的查询选择器和搜索条件匹配的项目信息。
认证: Bearer 令牌
参数
-
queryselectorenum 路径 必填 -
此查询可用的筛选条件
idorganization-idall -
searchstring 查询 -
用于搜索实体的关键字。
-
include_statusstring 查询 -
可选的状态参数,用于包含指定状态的项目。
-
exclude_statusstring 查询 -
可选的状态参数,用于排除指定状态的项目。
-
pageinteger 查询 -
页码,从 1 开始(默认 1)。
-
pageSizeinteger 查询 -
每页记录数(默认 25)。
响应
-
200成功。 -
500执行此操作时出错。
curl -X GET https://api.sommatic.ai/project/management/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/project/management/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/project/management/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json() 响应
{
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": "<ProjectManagement>"
}{
"status": 500,
"success": false,
"message": "Something was wrong while you make this action",
"result": null
}