retrieve all posts

26 views
Skip to first unread message

danielle_nl

unread,
Dec 10, 2010, 5:14:27 AM12/10/10
to Posterous development
Hi all,

I'm trying to work with the Posterous API. I've managed to retrieve
some posts using GET /api/2/users/me/sites/<'primary' or id>/posts
Above this line it says:"Get all posts for a site:" so I was hoping to
actually get all posts for my site but I only got the nine oldest
posts... Is there a way to up this?
I was hoping that this parameter: :page => INT # page number for
results set would have something to do with it but when I put &page=51
(all my posts) I get a blank page... So what does this parameter do?

TIA for your help and time, best, danielle.

Alex Popescu

unread,
Dec 12, 2010, 6:30:23 PM12/12/10
to Posterous development
It would be a huge overload for the server (and most of the clients)
to always return all posts. So, the API provides two mechanisms to
iterate through all posts:

- either page based (from latest to oldest):

you'll have to provide the page=<page_number> parameter (as in /api/2/
users/me/sites/<'primary' or id>/posts?page=<page_number>

- last retrieved post (from oldest to latest):

you'll have to provide the since_id=<last_retrieved_post_id> parameter
(as in /api/2/users/me/sites/<'primary' or id>/posts?
since_id=<post_id>)

The documentation would do a better job if it would provide a
description of:

- the result format
- the max number of posts returned by each of these requests

:- alex
Reply all
Reply to author
Forward
0 new messages