To retrieve the comments of a specific page, you can use the API endpoint https://documentation.viafoura.com/reference#get_-site-id-pages-id-comments. Note that if you want to retrieve the comments that are visible to users, you can call the endpoint directly; but if you also want to retrieve the comments that have been rejected/disabled by moderators, you need to be logged in as a moderator or administrator when you make the call.
This endpoint returns a maximum of 100 results per call. If the page contains more than 100 comments, you can use pagination in your calls to retrieve subsequent comments:
- Initial call: http://api.viafoura.co/v2/[siteid]/pages/[pageid]/comments?show=recent&limit=100
- Subsequent calls: http://api.viafoura.co/v2/[siteid]/pages/[pageid]/comments?show=recent&limit=100&after_id=[last-comment-id-in-previous-page]
If you don't know the page ID, you can retrieve it using the endpoint https://documentation.viafoura.com/reference#get_-site-id-pages-id, but using the encoded page path instead of the page ID.
Updated 9 months ago