Instagram-PHP-API icon indicating copy to clipboard operation
Instagram-PHP-API copied to clipboard

getUserMedia() and pagination

Open mapmyphotos opened this issue 8 years ago • 1 comments

Hi,

When I call getUserMedia() it will return only the latest 20 results. I have tried several ways to use pagination with this request but can't get it to work. Does getUserMedia() support pagination? What is the best way to get more that 20 results? Can you please provide a full example of how to use getUserMedia() with pagination to obtain all media.

Great library BTW, everything (except for this) was really easy to setup.

Thanks, Lachlan.

mapmyphotos avatar Mar 05 '16 01:03 mapmyphotos

Hi,

I have done some more reading in the Instagram developer documents and found there are some limits on the API while your client is in Sandbox mode. This should be a note for everyone as it's a little bit confusing, but after digging through the docs about sandbox mode it all makes sense.

For reference here is a link to the docs about sandbox and api limits while in sandbox mode:

https://www.instagram.com/developer/sandbox/

I think your code might actually work correctly when my client goes out of sandbox mode, if not it should be easy to modify the code slightly and using the "max_id" parameter in the getUserMedia method (specifying the max id (id of the photo) should return the next set of results after that photo).

mapmyphotos avatar Mar 07 '16 11:03 mapmyphotos