# 说明
返回符合查询条件的所有Wiki附件(分页显示,默认一页30条)
# url
https://apiv2.tapd.tencent.com/tapd_wikis_attachments
# 支持格式
JSON/XML(默认JSON格式)
# HTTP请求方式
GET
# 请求数限制
默认返回 30 条。可通过传 limit 参数设置,最大取 200。也可以传 page 参数翻页
# 请求参数
字段名 | 必选 | 类型及范围 | 说明 | 特殊规则 |
---|---|---|---|---|
id | 否 | integer | id | |
filename | 否 | string | 文件名 | |
size | 否 | int | 文件大小,字节 | |
owner | 否 | string | 上传者 | |
workspace_id | 是 | integer | 项目ID | |
created | 否 | datetime | 创建时间 | 支持时间查询 |
modified | 否 | datetime | 最后修改时间 | 支持时间查询 |
wiki_id | 否 | integer | 关联的wiki id | |
limit | 否 | integer | 设置返回数量限制,默认为30 | |
page | 否 | integer | 返回当前数量限制下第N页的数据,默认为1(第一页) | |
order | 否 | string | 排序规则,规则:字段名 ASC或者DESC,然后 urlencode | 如按创建时间逆序:order=created%20desc |
fields | 否 | string | 设置获取的字段,多个字段间以','逗号隔开 |
# 调用示例及返回结果
# 获取项目下的wiki附件
# curl 使用 Basic Auth 鉴权调用示例
curl -u 'api_user:api_password' 'https://apiv2.tapd.tencent.com/tapd_wikis_attachments?workspace_id=10104801'
# curl 使用 OAuth Access Token 鉴权调用示例
curl -H 'Authorization: Bearer ACCESS_TOKEN' 'https://apiv2.tapd.tencent.com/tapd_wikis_attachments?workspace_id=10104801'
# 返回结果
{
"status": 1,
"data": [
{
"Attachment": {
"id": "1141056048506227976",
"filename": "timg (10).jpg",
"size": "641037",
"owner": "dev",
"workspace_id": "41056048",
"created": "2021-01-06 20:24:51",
"modified": "2021-01-06 20:24:51",
"download_url": "https://file.tapd.oa.com/attachments/tmp_download/4ef28e23a472ca2555e39f1e7c263e6b?salt=6b105fd83862fcc1b46715654cfc5b27&time=1609986389",
"wiki_id": "1141056048001000274"
}
}
],
"info": "success"
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 字段说明
# 重要字段说明
- download_url
- 文件下载链接,仅当id存在时返回,无需登录态,5分钟有效期,访问一次后失效。
- 返回的数据为文件的内容,或者错误信息。错误信息包括:"file not exits"(文件不存在时返回),"token expire"(token过期或者无效时返回)