#diipak.batham-List
1 messages ยท Page 1 of 1 (latest)
Hey, Can you guide me what I am doing wrong?
This is normal
by default the limit on the List calls is 10
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So, what should I do to get full data?
You'd have to do some pagination in order to get all results
All record.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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
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.
you're not using our stripe-node SDK?
No, It is what I find helpful to get the data.
as I mentioned you should be looking at this example here https://stripe.com/docs/api/pagination/auto?lang=node
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
it applies to all List APIs
// Do something with customer
}```
Thank you