【问题标题】:How to pass query string parameters to Smartsheet API with node.js?如何使用 node.js 将查询字符串参数传递给 Smartsheet API?
【发布时间】:2015-12-16 00:33:51
【问题描述】:

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

大多数索引端点默认为 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

【问题讨论】:

    标签: node.js smartsheet-api


    【解决方案1】:

    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);
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-04-18
      • 2016-08-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-09-03
      • 2014-11-02
      相关资源
      最近更新 更多