Hey Peter McGrath, I believe currently we can make use of the cursor to find the next set of members after limit is reached, however I think it is possible to order the set of results by date_created as well.
I just checked this by making an api call to get the list of members and added order=DESC as query parameter, and it seems to give me results in descending order based on the creation date and vice versa happens when I pass ASC as the order.
the limit is 100, did this for a project, the only way to get above 100, is to send request async, and get the endcursor to add the after param dynamically till there's no endcursor, making it the end of the list.
here's a sample script I used for a recent project
<script> const statusDiv = document.getElementById('status'); const startButton = document.getElementById('startButton'); startButton.onclick = function() { this.disabled = true; // Disable button to prevent multiple triggers fetchMembers('/members'); }; function fetchMembers(url) { fetch(url, { headers: { 'Accept': 'text/plain' } }) .then(response => response.text()) .then(data => { // Append the result to the status div statusDiv.innerHTML += \`\${data}</p>\`; // Extract next batch URL from the data const nextBatchMatch = data; console.log(nextBatchMatch); if (nextBatchMatch && nextBatchMatch[1]) { // Continue fetching the next batch fetchMembers(\`/members?after=\${data}\`); } else { statusDiv.innerHTML += '<p>All data has been fetched.</p>'; startButton.disabled = false; } }) .catch(error => { statusDiv.innerHTML += \`<p>Error fetching data: \${error}</p>\`; startButton.disabled = false; }); } </script>
Comments
13 comments
Max is 100.
is it possible to ask for more?
Beyond 100, you’ll need to paginate.
Where are you using the api?
I can give you example code.
google cloud console, tho. i'd appreciate!
What language?
node js
Sweet.
Yeah I’ll send you some code.
can you use NPM packages in your project?
We have a NPM package that makes using our API easier.
im not using webflow, but a more limiting cms. that s why i am using gcf.
so no, i can not use npms
do you know what version of node you are using?
thankies!
any way to get the list members limit above 100?
Actions
List Members
Get a paginated list of members:
Optional parameters:
after - Pagination cursor
order - ASC or DESC
limit - Max number to return (default 50)
or order by date_created ?
Hey Peter McGrath, I believe currently we can make use of the cursor to find the next set of members after limit is reached, however I think it is possible to order the set of results by date_created as well.
I just checked this by making an api call to get the list of members and added order=DESC as query parameter, and it seems to give me results in descending order based on the creation date and vice versa happens when I pass ASC as the order.
Let me know if this helps.
the limit is 100, did this for a project, the only way to get above 100, is to send request async, and get the endcursor to add the after param dynamically till there's no endcursor, making it the end of the list.
here's a sample script I used for a recent project
Please sign in to leave a comment.