#diipak.batham-List

1 messages ยท Page 1 of 1 (latest)

little sapphire
#

๐Ÿ‘‹ happy to help

terse moon
#

Hey, Can you guide me what I am doing wrong?

little sapphire
#

This is normal

#

by default the limit on the List calls is 10

terse moon
#

So, what should I do to get full data?

little sapphire
#

You'd have to do some pagination in order to get all results

terse moon
#

All record.

little sapphire
#

using auto-pagination is the best way to get all your records

#

to reduce the amounts of API calls you could set the limit to 100 for example

terse moon
#

And where I can define this limit.
// set the endpoint
let url = 'https://api.stripe.com/v1/subscriptions';

// set the params object
//let request = url + API_KEY

let params = {
'method' : 'get'
, 'headers': {'Authorization': 'Bearer '+ API_KEY}
, muteHttpExceptions: true

}

let response = UrlFetchApp.fetch(url,params);

let data = JSON.parse(response.getContentText());

//console.log(data)

const results = data.data.map( post => {

  return [post["id"],post["application"]];

})

This is the code I am using.

little sapphire
#

you're not using our stripe-node SDK?

terse moon
#

No, It is what I find helpful to get the data.

little sapphire
#

it applies to all List APIs

#
  // Do something with customer
}```
terse moon
#

Thank you