# 说明

返回符合查询条件的所有花费工时(分页显示,默认一页30条)

# url

https://api.tapd.cn/timesheets

# 支持格式

JSON/XML(默认JSON格式)

# HTTP请求方式

GET

# 请求数限制

默认返回 30 条。可通过传 limit 参数设置,最大取 200。也可以传 page 参数翻页

# 请求参数

字段名 必选 类型及范围 说明 特殊规则
id integer id 支持多ID查询
workspace_id integer 项目ID
entity_type string 对象类型,如story、task、bug等
entity_id integer 对象ID
timespent string 花费工时
spentdate date 花费日期 支持时间查询
modified date 最后修改时间 支持时间查询
owner string 花费创建人
include_parent_story_timesheet integer 值=0不返回父需求的花费
created datetime 创建时间 支持时间查询
memo string 花费描述
is_delete integer 是否已删除。默认取 0,不返回已删除的工时记录。取 1 可以返回已删除的记录
limit integer 设置返回数量限制,默认为30
page integer 返回当前数量限制下第N页的数据,默认为1(第一页)
order string 排序规则,规则:字段名 ASC或者DESC,然后 urlencode 如按创建时间逆序:order=created%20desc
fields string 设置获取的字段,多个字段间以','逗号隔开

# 调用示例及返回结果

# 获取项目下的花费工时信息

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' 'https://api.tapd.cn/timesheets?workspace_id=10158231&limit=3'

# 返回结果

{
    "status": 1,
    "data": [
        {
            "Timesheet": {
                "id": "1010158231001168997",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "8",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:35",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168995",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "2",
                "spentdate": "2020-05-06",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:05",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168993",
                "entity_type": "task",
                "entity_id": "1010158231500606309",
                "timespent": "3",
                "spentdate": "2020-05-06",
                "owner": "anyechen",
                "created": "2020-05-06 19:22:07",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        }
    ],
    "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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

# 获取项目下 2020年5月5日 的花费工时信息

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' 'https://api.tapd.cn/timesheets?workspace_id=10158231&spentdate=2020-05-05'

# 返回结果

{
    "status": 1,
    "data": [
        {
            "Timesheet": {
                "id": "1010158231001168997",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "8",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:35",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168987",
                "entity_type": "task",
                "entity_id": "1010158231500606309",
                "timespent": "2",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 18:33:31",
                "workspace_id": "10158231",
                "memo": null
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168971",
                "entity_type": "task",
                "entity_id": "1010158231500606305",
                "timespent": "1",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 12:57:08",
                "workspace_id": "10158231",
                "memo": "xxx"
            }
        }
    ],
    "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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

# 获取需求ID为 1120003271001000198 的花费工时信息

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' 'https://api.tapd.cn/timesheets?workspace_id=10158231&entity_type=story&entity_id=1010158231500709717'

# 返回结果

{
    "status": 1,
    "data": [
        {
            "Timesheet": {
                "id": "1010158231001168997",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "8",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:35",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168995",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "2",
                "spentdate": "2020-05-06",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:05",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        }
    ],
    "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
28
29
30
31
32

# 获取项目下某成员的花费工时时间

# curl 使用 Basic Auth 鉴权调用示例

curl -u 'api_user:api_password' 'https://api.tapd.cn/timesheets?workspace_id=10158231&owner=anyechen&limit=3'

# 返回结果

{
    "status": 1,
    "data": [
        {
            "Timesheet": {
                "id": "1010158231001168997",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "8",
                "spentdate": "2020-05-05",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:35",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168995",
                "entity_type": "story",
                "entity_id": "1010158231500709717",
                "timespent": "2",
                "spentdate": "2020-05-06",
                "owner": "anyechen",
                "created": "2020-05-06 19:32:05",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        },
        {
            "Timesheet": {
                "id": "1010158231001168993",
                "entity_type": "task",
                "entity_id": "1010158231500606309",
                "timespent": "3",
                "spentdate": "2020-05-06",
                "owner": "anyechen",
                "created": "2020-05-06 19:22:07",
                "workspace_id": "10158231",
                "memo": "hey"
            }
        }
    ],
    "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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

# 花费工时字段说明

# 花费工时重要字段说明

字段 说明
id id
entity_type 对象类型,如story、task、bug等
entity_id 对象ID
timespent 花费工时
spentdate 花费日期
owner 花费创建人
created 创建时间
workspace_id 项目ID
modified 最后修改时间
memo 花费描述
is_delete 是否已删除
上次更新: 2023-10-19 15:09:56