• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

How to retrieve all posts by user via Read API?

Scheduled Pinned Locked Moved Solved NodeBB Development
3 Posts 2 Posters 337 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    greyteapot
    wrote on last edited by greyteapot
    #1

    My goal is to use the Read API to calculate the postcount of a user for a certain period of time.

    For this my approach would be to query all postings of a user and then filter out on the code side those postings that lie in a given period.
    According to the Read API documentation I have queried the user posts via:

    GET /api/user/{userslug}/posts
    

    However, it seems that this API call only returns a maximum of 20 posts.

    But how can I retrieve all posts of a user?

    I also tried this API call:

    GET /api/user/uid/{userslug}/export/posts
    

    but it doesn't seem to work at all (maybe it is outdated?). If I change the user slug accordingly, I get no result page, but 404.

    1 Reply Last reply
    0
  • barisB Offline
    barisB Offline
    <baris> NodeBB
    wrote on last edited by
    #2

    You should be able to use pagination on the /api/user/{userslug}/posts route. IE /api/user/{userslug}/posts?page=2.

    G 1 Reply Last reply
    0
  • G Offline
    G Offline
    greyteapot
    replied to <baris> on last edited by greyteapot
    #3

    @baris said in How to retrieve all posts by usere via Read API?:

    ?page=2

    that one works, thanks a bunch!

    I tried pagination before, but I was somehow expecting it to work like /{pagenumber}.

    Just for the record: Meanwhile I also understood, that what I was looking for is also achievable via /api/search and corresponding filters.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development