T
Twenty6mo ago
Rob

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
charles
charles6mo ago
Yes, it seems that we have an issue here @martmull could you take a look when you get a change?
Rob
RobOP6mo ago
Thanks for confirming @charles
martmull
martmull6mo ago
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
charles
charles6mo ago
it seems to be quite easy to fix @martmull ticket for a good first issue or for gitstart maybe?
martmull
martmull6mo ago
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
charles
charles6mo ago
Could you create a ticket and assign it to Gitstart? looks high prioirty as findMany endpoints are kind of useless without the pagination
martmull
martmull6mo ago
We should ipdate the open-api doc also okok
charles
charles6mo ago
ty!
Rob
RobOP6mo ago
Thank you both!
charles
charles6mo ago
Wonderful!
Rob
RobOP6mo ago
Just tested this on v0.20 and it works great, thank you
Want results from more Discord servers?
Add your server