why did you choose such a complicated paging operation ?


Userlevel 3
Badge +1

 

I understand the need to force a pagination (although 100; it's still a bit low.)

But then the stroke of the cursor, I do not understand.

Could a simple "offset" have been suitable?

Limit=100&offset=0, Limit=100&offset=100, Limit=100&offset=200, …
 

In any case, it complicates my work terribly.


Maybe making access difficult and complicated is a way to reduce the load on api servers.


10 replies

Userlevel 2
Badge +1

Hello Christophe,

First things first, I’m so sorry to hear that the pagination is complicating your work terribly. We will try our best to assist you and ease the troubles.
 

I checked with our API team and they mentioned that cursors are better suited for frequently changing data because they eliminate the possibility of skipping items and displaying the same item more than once. This pagination approach is also used by other popular API providers.

To help us in assisting you on this, can you please explain or provide more information about the use case and the troubles you are facing. We’ll try our best to provide some guidance once we have more information around the issue. 

Thanks and have a good one. 

 

Cheers,

Mira

Userlevel 3
Badge +1

I use a tool:called denodo. This tool can is “magic” to mix datas from API, database, structured files, …. and let use mix all data like sql table/views.

There is 4 options to fetch data on api with pagination :
 HTTP Path — Virtual DataPort Administration Guide (denodo.com)

No one works with cursors.

 

Userlevel 2
Badge +1

Hello Christophe,

 

Thanks for providing more information. Here’s what the team has recommended. Can you please try this out:

 

The second option (Obtain the “Next Page URL” from the Body of the Response) that your tool provides will work with our pagination:

 

{
"size": 10,
"limit": 10,
"total": 22,
"data": [
...
],
"links": {
"self": "https://api.miro.com/v2/boards/uXjVMOreMKE=/items?limit=10&cursor=",
"next": "https://api.miro.com/v2/boards/uXjVMOreMKE=/items?limit=10&cursor=MzQ1ODc2NDU1MzI2OTExNDI2NH4%3D", <- he can use this link
"last": "https://api.miro.com/v2/boards/uXjVMOreMKE=/items?limit=10&cursor=MzQ1ODc2NDU1MzI2OTExNDI5N34%3D"
},
"cursor": "MzQ1ODc2NDU1MzI2OTExNDI2NH4=",
"type": "cursor-list"
}

 

Cheers,

Mira

 

Userlevel 3
Badge +1

Aaah  Nice trick, I would try this and  give feedback .

Userlevel 3
Badge +1

@Mira Balani  indeed,  this solution is perfect …. for  board list but  the "links" section doesn’t exist for “members list”

Get boards (miro.com) ← OK

Get organization members (miro.com)  ← Not Ok

Userlevel 2
Badge +1

Hey Christophe, 

 

You’re right, the get organization members API does not have the links parameter implemented at the moment. I will check with the Enterprise team tomorrow on whether they have plans to implement this and also share the user case/feedback you provided to them. I’ll circle back when I have an update on this or if they have a workaround that you can use in the meanwhile. 

 

Cheers,

Mira

Userlevel 3
Badge +1

A big thanks.

Userlevel 2
Badge +1

Hey there Christophe,

How are you doing? I’m back with a possible solution for you regarding the issue you had with

Get organization members (miro.com)  

 

I checked with the team and they mentioned that based on this document on denodo, we think that the third option should work for your use case. 

Parameter in URL for "next" token: cursor

Path to "next" token in response: cursor

 

The cursor paragraph here sums up cursor-based pagination usage:

The ID of the organization member used as the reference for pagination. To retrieve the first portion of the collection don't pass a cursor value. To retrieve the next portion of the collection, set the cursor parameter value to the ID of the last organization member you received in the response of the previous request. 
 

Can you please check and see if this resolves the issue for you?

 

Thanks and have a good one.

 

Cheers, 

Mira

Userlevel 3
Badge +1

Wonderful, it’s works. We can really mark this as solved

Userlevel 2
Badge +1

Hello Christophe, 

Thanks for circling back. Good to know this works for you! 

Cheers,

Mira

Reply