Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass query string parameters to Smartsheet API with node.js?

I need to get a list of all columns in one request and manual states that I should pass query string parameter:

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.

Here is that I tried:

var options = {
    sheetId: 2252168947361668,
    includeAll: true
};

smartsheet.sheets.getColumns(options)
    .then(function (data) {
        console.log(data);
    })
    .catch(function (error) {
        console.log(error);
    });

But it returns me only first 100 columns. How should I pass query string parameters to smartsheet-api from node.js?

like image 828
untitled Avatar asked Jan 17 '26 20:01

untitled


1 Answers

The includeAll parameter is a query string parameter so it must be included in the queryParameters object. The following should work for you:

var options = {
    sheetId: 2252168947361668,
    queryParameters: {
      includeAll: true
    }
};

smartsheet.sheets.getColumns(options)
    .then(function (data) {
        console.log(data);
    })
    .catch(function (error) {
        console.log(error);
    });
like image 153
Brett Avatar answered Jan 20 '26 09:01

Brett