【发布时间】:2017-01-09 02:46:03
【问题描述】:
我正在尝试让 update_rows 方法工作
(这里的答案还没有帮助:
cannot update row using Smartsheet API
)
并且想要捕获和解析结果
results = smartsheet.Sheets.update_rows(test_sheet_id, [row])
print(results)
给我这个:
{"requestResponse": null, "result": {"shouldRetry": false, "name":
"InvalidRowLocationError", "code": 1062, "recommendation": "Do not retry
without fixing the problem.", "message": "Invalid row location.",
"statusCode": 400}}
请注意,成功看起来像这样(大部分都被剪掉了):
{"resultCode": 0, "message": "SUCCESS", "version": 21, "result":
[{"discussions": [], "createdAt": null, "above": null, "modifiedAt":
null, "columns": [], "toTop": null, "sheetId": null, "siblingId":
4800885606901636, "permalink": null, "id": 6067523002099588,
"accessLevel": null, "conditionalFormat": null, "attachments": [],
"cells": [{"columnType": null, "displayValue": null, "linksOutToCells":
null, "strict": true, "hyperlink": null, "formula": null, "format": null,
"conditionalFormat": null, "columnId": 7600931584927620, "linkInFromCell":
null, "value": null}, {"columnType": null, "displayValue": null, "
... snip ...
这看起来像字典,但无法识别键、项和值。 接下来它看起来像 json - 但我没有尝试过(我对 json 还不太了解)。
如果我能从成功中获得 resultCode,那将是一个开始。 result 中的值会更好,但这似乎是失败的字典和成功的列表。
我很困惑。任何帮助表示赞赏。 我正在使用 Python 3.5、Smartsheet API 2.0 Python SDK
克雷格
【问题讨论】:
标签: python smartsheet-api