我需要在一个请求中获取所有列的列表,并且手册指出我应该传递查询字符串参数:
Most index endpoints default to a page size of 100 results. If you need all results at once, you should specify the includeAll=true query string parameter.
这是我试过的:
var options = {
sheetId: 2252168947361668,
includeAll: true
};
smartsheet.sheets.getColumns(options)
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});
但它只返回前 100 列。
我应该如何将查询字符串参数从 node.js 传递到 smartsheet-api
?
最佳答案
includeAll 参数是一个查询字符串参数,因此它必须包含在 queryParameters 对象中。以下应该适合您:
var options = {
sheetId: 2252168947361668,
queryParameters: {
includeAll: true
}
};
smartsheet.sheets.getColumns(options)
.then(function (data) {
console.log(data);
})
.catch(function (error) {
console.log(error);
});
关于node.js - 如何使用 node.js 将查询字符串参数传递给 Smartsheet API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34302039/