添加记录
... 2026-2-4 大约 1 分钟
# 添加记录
# 接口说明
本接口用于在 Smartsheet 中的某个子表里添加一行或多行新记录。
注意
不能通过添加记录接口给创建时间、最后编辑时间、创建人和最后编辑人四种类型的字段添加记录。
# 请求格式
| 描述 | 定义 |
|---|---|
| Path | /openapi/smartsheet/v2/files/{fileID}/sheets/{sheetID}/records |
| Method | POST |
| Content-Type | application/json |
| Accept | application/json |
# 请求头部
详见Headers。
# 请求参数
# 查询参数
无
# 请求体
| 参数名 | 类型 | 必选 | 描述 |
|---|---|---|---|
| addRecords | JSON Object(AddRecordsRequest) | 是 | 添加记录请求 |
# 响应参数
# 请求体
| 参数名 | 类型 | 描述 |
|---|---|---|
| ret | integer | 业务返回码 |
| msg | string | 业务返回码描述 |
| data.addRecords | JSON Object(AddRecordsResponse) | 添加记录响应 |
# 请求包体
POST /openapi/smartsheet/v2/files/DAAAAAAAAAAAA/sheets/at5j8y/records HTTP/1.1
Access-Token: ACCESS_TOKEN
Client-Id: CLIENT_ID
Content-Type: application/json
Content-Length: 1
{'addRecords': {'records': [{'values': {'文本': [{'type': 'text', 'text': '测试'}], '数字': 1234567890}}, {'values': {'文本': [{'type': 'text', 'text': '文档'}], '数字': 666}}]}}
1
2
3
4
5
6
7
2
3
4
5
6
7
1
2
3
4
5
6
7
2
3
4
5
6
7
# 示例
curl --location --request POST 'https://{domain}/openapi/smartsheet/v2/files/DAAAAAAAAAAAA/sheets/at5j8y/records' \
--header 'Access-Token: ACCESS_TOKEN' \
--header 'Client-Id: CLIENT_ID' \
--header 'Content-Type: application/json' \
--data-raw '{
"addRecords": {
"records": [{
"values": {
"文本": [{
"type": "text",
"text": "测试"
}],
"数字": 1234567890
}
},
{
"values": {
"文本": [{
"type": "text",
"text": "文档"
}],
"数字": 666
}
}
]
}
}'
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
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