Closed PaulieScanlon closed 8 years ago
Hey @PaulieScanlon
To get product comments you can either:
1) Get details for given post
2) Fetch stream of comments where search[post_id] = POST_ID
About fetching votes - PostVotes
Vlad
Hey Vlad thanks for that!
ok so looking up all comments on a post works now: https://api.producthunt.com/v1/comments?search[Ubeen]
The votes thing though, can that work in the same way?
This is wrong: https://api.producthunt.com/v1/posts/1/votes?search[Ubeen] as is this 'https://api.producthunt.com/v1/posts/Ubeen/votes'
What am i missing here?
Cheers!
@PaulieScanlon https://api.producthunt.com/v1/posts/1/votes?search[Ubeen]
should become -> https://api.producthunt.com/v1/posts/__UBEEN_POST_ID__/votes
productId
is a must for this query :)
Cheers
hey, thanks man! so, final question, how would a user know the post id in order to look it up in my app?
Hm i think you will need 2 queries.
GET
product by given name. where you can get the id
GET
all votes for product with id
Note: It is assumed, that you should have post id in order to get the details about it. Thats why v1/posts/POSTID/votes
and related work with id
Hope this will help. 👍
Ok cool, i'll investigate that route! thanks for your help man! very speedy and much appreciated!
Actually, which part of the api should is use to get the product by given name?
this doesn't return anything: https://api.producthunt.com/v1/posts/all?search[url]=https://www.producthunt.com/tech/ubeen
this works: https://api.producthunt.com/v1/posts/all?search[url]=https://www.ubeen.io
but that would require a user to know the URL of the product they wanted to look up.
ah, ok don't worry i was missing an '&' https://api.producthunt.com/v1/posts/'+statData.postId+'/votes?newer='+statData.lastVoteId+'&order=asc
You can close this issue now. This one's my bad! :)
Hi, whats the best way to make a call to actual product. So if i wanted to get all comments and votes for https://www.producthunt.com/tech/ubeen
The below doesn't work, but that's probably because i'm doing it wrong:
https://api.producthunt.com/v1/posts/all?search[url]=Ubeen'
any ideas?
Cheers!