智能表格添加数据报错,查不出具体原因?
提问
参考文档:https://developer.work.weixin.qq.com/document/path/100224#%E6%B7%BB%E5%8A%A0%E8%AE%B0%E5%BD%95
返回结果:
{'errcode': 2543303, 'errmsg': 'SmartsheetV2 Service Error, hint: [1734061551123491932172958], from ip: 52.80.43.60, more info at https://open.work.weixin.qq.com/devtool/query?e=2543303'}
相关代码:
def write_to_excel(access_token, data_list):
api_url = "https://qyapi.weixin.qq.com/cgi-bin/wedoc/smartsheet/add_records?access_token=" + access_token
headers = {
"Content-Type": "application/json",
}
docid = "dcd6CpHdzQe2AN111OC49OR-ox5x_r86VEbfFxKKkbqPiFDQmoaelKBJD24uYykgTgOkVXHArkCEN8bKVHdPnV7A"
sheet_id = "仪表盘1"
payload = {
"docid": docid,
"sheet_id": sheet_id,
"key_type": "CELL_VALUE_KEY_TYPE_FIELD_TITLE",
"records": [{
"values": {
"次数": [{
"type": "text",
"text": "2"
}],
"项目":[{
"type": "text",
"text": "项目1"
}],
"服务": [{
"type": "text",
"text": "服务1"
}],
"发布状态": [{
"type": "text",
"text": "success"
}],
"发布人": [{
"type": "text",
"text": "何瑾"
}],
"发布分支": [{
"type": "text",
"text": "release"
}],
"地址": [{
"type": "text",
"text": "http://xxx/xx"
}],
}
}]
}
response = requests.post(api_url, data=json.dumps(payload), headers=headers)
print("response————————", response)
if response.status_code == 200:
print("response.json()————————", response.json())
return response.json()
else:
raise Exception(f"Failed to write data to Excel. Status code: {response.status_code}, Error: {response.text}")
是的,创建的时候"doc_type": 10,
您好,请问确认这是智能表格吗?
https://developer.work.weixin.qq.com/document/path/99911