# 说明
通过工作项短id换长id
# url
https://api.tapd.cn/workspaces/get_workitems_long_id_by_short_ids
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求参数
| 字段名 | 必选 | 类型及范围 | 说明 | 特殊规则 |
|---|---|---|---|---|
| short_ids | 否 | string | 短ID,多个以;分隔 | short_ids和long_ids不允许都不传 |
| long_ids | 否 | string | 长ID,多个以;分隔 | |
| workspace_id | 是 | integer | 项目id | |
| entity_type | 是 | string | 查找业务对象类型的范围 | 候选值:story,task,bug |
其余支持参数参照各业务对象的获取文档
# 调用示例及返回结果
# 根据短id获取业务对象信息
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' 'https://api.tapd.cn/workspaces/get_workitems_long_id_by_short_ids?short_ids=1000276;1000277;1000104&workspace_id=48464494&entity_type=story'
curl 'https://api.tapd.cn/workspaces/get_workitems_long_id_by_short_ids?short_ids=1000276;1000277;1000104&workspace_id=48464494&entity_type=story&access_token=ACCESS_TOKEN'
# 返回结果
"status": 1,
"data": {
"valid_id_map": [
{
"short_id": "1000276",
"long_id": "1148464494001000276",
"entity_type": "story",
"workspace_id": "48464494",
"company_id": "39418254"
},
{
"short_id": "1000277",
"long_id": "1148464494001000277",
"entity_type": "story",
"workspace_id": "48464494",
"company_id": "39418254"
}
],
"invalid_long_ids": [
"1000104",
"123213223121000276",
"1231231231231231000277"
],
"invalid_short_ids": []
},
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# 请求参数
| 字段名 | 说明 |
|---|---|
| valid_id_map | 有效的id集合 |
| long_id | 长ID |
| short_ids | 短ID |
| company_id | 公司ID |
| workspace_id | 项目id |
| entity_type | 查找业务对象类型的范围候选值:story,task,bug |
| invalid_long_ids | 无效的长id集合 |
| invalid_short_ids | 无效的短id集合 |
# 数据权限说明
# 如返回结果受限,可按如下规则确认数据权限
- 确认API账号是否有对应的业务对象获取权限
- 确认传入的短id是否是在当前业务对象类型下