如何使用node.js将查询字符串参数传递给Smartsheet API?

时间:2015-12-16 00:33:52

标签: node.js smartsheet-api

我需要在一个请求中获取所有列的列表,并且手动指出我应该传递查询字符串参数:

  

大多数索引端点默认为100个结果的页面大小。如果你   一旦需要所有结果,您应该指定includeAll = true查询   字符串参数。

这是我尝试过的:

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

1 个答案:

答案 0 :(得分:5)

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);
    });
相关问题