REST API last_cursor usage
Hi Twenty Team,
Thanks for the wonderful software. I have been interacting with the system using the REST API and it has been a huge productivty boost, thanks!
However, I can not seem to figure out how to use the
last_cursor
variable.
For example, when calling Find Many companies
via https://{url}.com/rest/companies
what should be passed in to the last_cursor variable? It says that it should be a string, I have tried passing in the last id from the previous call, and have tried passing in a a number or name of the last company.
Can you provide some guidance to push me in the right direction to figure out how this works? My apologies if this is obvious for a developer.12 Replies
Yes, it seems that we have an issue here
@martmull could you take a look when you get a change?
Thanks for confirming @charles
Yes, indeed there is an issue on that point @Rob, we need to provide the information of nextCursor in the findMany results, currently it is not possible to get it via the rest api
Waiting for the fix, you should use the graphql api sadly
it seems to be quite easy to fix @martmull ticket for a good first issue or for gitstart maybe?
yes, we should just add the info in the {entities: [entity1,entity2], startCursor: val, nextCursor: val, count: val }
I looked up quickly we request the info with the graphql api, but I think the data formating vanished it
Could you create a ticket and assign it to Gitstart?
looks high prioirty as findMany endpoints are kind of useless without the pagination
We should ipdate the open-api doc also
okok
ty!
Thank you both!
PR opened 😉 -> https://github.com/twentyhq/twenty/pull/5841
Wonderful!
Just tested this on v0.20 and it works great, thank you