我正在尝试使用 Node.js sdk 通过include
get-sheet 请求smartsheet.sheets.getSheet(options)发送参数。API 文档对如何include
在 API 调用中添加参数含糊不清。
我在 Smartsheet API 中发现了一篇 Smartsheet 开发人员博客文章Demystifying Query Parameters in the Smartsheet API提供了更多指导,但他们提供的 Node.js 示例代码是无效的 javascript:
// Set options
var options = {
queryParameters: {
include: "attachments",
include: "source",
includeAll: true
}
};
// List sheets
smartsheet.sheets.listSheets(options)
.then(function(response) {
...
在上面的代码中,最后一个include
查询参数将覆盖所有先前的值,您将得到一个options
丢失“附件”参数的变量:
queryParameters: {
include: "source",
includeAll: true
}
对我来说,显而易见的解决方案是include
采用如下数组:
include: ["attachments", "source"],
有什么建议么?