T
Twenty5mo 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
charles5mo ago
Yes, it seems that we have an issue here @martmull could you take a look when you get a change?
Rob
RobOP5mo ago
Thanks for confirming @charles
martmull
martmull5mo 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
charles5mo ago
it seems to be quite easy to fix @martmull ticket for a good first issue or for gitstart maybe?
martmull
martmull5mo 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
charles5mo 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
martmull5mo ago
We should ipdate the open-api doc also okok
charles
charles5mo ago
ty!
Rob
RobOP5mo ago
Thank you both!
charles
charles5mo ago
Wonderful!
Rob
RobOP5mo ago
Just tested this on v0.20 and it works great, thank you
Want results from more Discord servers?
Add your server