Help to get recent posts through api
-
Hello , I have a situation :
We disallow the guset user to access the categories including the find , access and read privileges , so user must to login to see the posts and we can keep the forum private.But , we want to get the recent posts through the /api/recent , and show these informations in another web site (the users are also the register-users in the forum), and in this case , the api return nothing .
I'm wondering if there is a solution to this case , thank you !
-
Yes, you should install the
write-api
plugin. Although this exposes a set of write-enabled endpoints, it also uses its own authentication, and extends this to cover the read-only endpoints.So with that plugin, you can give an admin user a user token, and then you can
GET /recent
with the user token in theAuthorization
header. -
I would post an issue on the write-api repository to remind @julian to have a look when he gets a chance
-
can you limit the # of recent posts to get via param, say if you only want 2 of the most recent?