Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Comments API endpoint help
burnet
New
Hi,
I've been wanting to try out the new API.
So, I can get a particular discussion given it's ID, like so:
https://open.vanillaforums.com/api/v2/discussions/35687
So what if I want to get the comments for this discussion? /api/v2/comments reports that "One of discussionID, insertUserID are required" - great. So I try this:
https://open.vanillaforums.com/api/v2/comments?discussionID=35687
But all I get back is an empty list.
Let's try insertUserID:
https://open.vanillaforums.com/api/v2/comments?insertUserID=10878
Still an empty list back.
Is this a permission thing? If not can someone please help me out and tell my what I'm doing wrong? Thanks!
0
Comments
You are better off using the basic read only api. there little documentation on the api endpoint
All the information you need can be found with
https://open.vanillaforums.com/discussion/35687.json
grep is your friend.
Note: be careful don't expect the data to be sanitised.
grep is your friend.
Thanks @x00 for the information! I thought the v2 API was more fleshed out.
Is there any docs at all for the read only API? Like limits, pagination, etc?
not really.
The read only API uses the same controller it is just retunring the data used rather than the page. You can also just return the view and not the whole page.
You have
CountComments
andPage
and you can count the number of comment on that page. The rest you can work out.adding
.json
to the url Is a a quick way of adding?DeliveryMethod=JSON&DeliveryType=DATA
This is the best you will get in terms of documentation.
Also
library/core/class.controller.php
give you an idea of what is goign onif you wanted just the view you could do
?DeliveryMethod=JSON&DeliveryType=VIEW
grep is your friend.
Out of interest what are you trying to do what si this for?
grep is your friend.
The goal is to essentially search a set of discussions for a few conditions, based on their content - Thanks again for the info, makes sense, I will give this a go.