API pagiantion


#1

Hi,
is it possible to paginate using “Retrieve collection posts” API call? (https://developers.write.as/docs/api/#retrieve-collection-posts)

I am trying to create simple app for printing write.as articles to paper (nothing sophisticated - just fetch article markdown, render it as HTML and apply heavy print-optimized CSS inspired by https://github.com/vladocar/Hartija---CSS-Print-Framework).

However, I need to translate slug of post e.g. blog/we-just-released-a-few-updates-to-write-as-on-the-web to it’s ID. I wanted to do it with enumeration of posts in collection, but it’s seems there is a limit of posts you can enumerate.

TL;DR - how to fetch page 2 in collection or how to translate full slug to ID?


#2

Sounds really cool! I’d love to see / promote that app when you’re finished, if you’d like to share it. But no pressure.

Both these things weren’t supported yet, so I’ve added them to the API. There’s a new endpoint for retrieving a single collection post (which includes the post’s ID), and now you can add a page query parameter (e.g. ?page=2) to the Retrieve collection posts endpoint to get later pages.