Dhruv Parmar

API Support

Facing any issues with the API? Share them here
364 views

Add a comment

Replies

Best
Rishi
@dhruvparmar I see some planned updates to APIs here and see recent changes on github. Will the docs be updated asap or do we need to keep an eye here and on github?
Dhruv Parmar
@wayfarerish hey, any updates to the GraphQL interface of the API will always reflect in the reference here http://api-v2-docs.producthunt.c... Unfortunately we don't have a change-log yet so we've decided to publish those updates here as well for the Makers festival participants.
Rishi
@dhruvparmar thank you! :)
Sam Ben
@dhruvparmar Hey, amazing job on the GraphQL API. Are you guys going to add more fields to the post query? I need the post makers and images also reviews would be great ;)
Arj Singh
@dhruvparmar @ossamaweb Yeah I agree. A link to product videos would be handy too. Hope we can get access to this.
Dhruv Parmar
@ossamaweb @asingh thanks for feedback guys 🙌. We should be able to add those fields to Post query. I'll update here once they are added. Would be good if you could elaborate how you'd be using them in your respective applications?
bhautik_mba

@ossamaweb  @asingh  @dhruvparmar 

any update on the data fetching post makers or users of comments on the post.

and also review.

Dhruv Parmar
Hey everyone! Dhruv from the engineering team at Product Hunt. The new version for the Product Hunt public API is built using GraphQL. We want you to have a smooth experience while integrating with the API and I'll be here to assist you in any issues that might arise. Here are some quick tips to get started: 1. To explore the GraphQL interface of the API quickly, you can use the GraphiQL Explorer app. 2. We've published a minimal Node + React App as a starter kit on Github here. Happy Hacking 💻🚀!
Akshay Ashok
@dhruvparmar I'm trying minimal Node + React App as a starter kit, but on clicking Login with product hunt, it get redirected to /authorize but nothing seems to happen. also there is this POST http://localhost:3001/graphql 404 (Not Found) in console.
Viktor Slobodanov
@dhruvparmar Amazing job!
Dhruv Parmar
@akshay_ashok1 Hey, please make sure to copy `.env.sample` file and rename it to `.env` file in your project root. Also update all `PH_` variables in the `.env` file to appropriate values. I'm guessing there is an issue with the environment variables.
Akshay Ashok
@dhruvparmar I can't figure out the client Credential token part
Dhruv Parmar
We've made following updates to the API: 1. Added `GoalCreate` mutation which allows to create goals on behalf of the authenticated user. http://api-v2-docs.producthunt.c... 2. Added `videoUrl` field to `media` object for Posts. http://api-v2-docs.producthunt.c... 3. Fixes to `GoalUpdate` mutation. 4. Fixed order of `media` items for Post. For further details check out the GraphQL reference here http://api-v2-docs.producthunt.c... cc @ossamaweb @jpeguin1 @wayfarerish @raghuv_adhepalli @roy_shao
JPEGuin
Knight 
@dhruvparmar thanks for add Goal Create, how about Project Create ? will it be added ?
Rishi
@dhruvparmar thanks! :)
Dhruv Parmar
@imknight We wouldn't be adding project create as of now. I'll keep you updated here incase something changes.
Dhruv Parmar
API Update: We've added capability to cheer goals via the API. Also GoalType now has `cheer_count` to fetch count of cheers on a Goal. For details check out the the following links: 1. GoalCheer - http://api-v2-docs.producthunt.c... 2. GoalCheerUndo - http://api-v2-docs.producthunt.c... 3. "cheerCount" on GoalType http://api-v2-docs.producthunt.c... cc @wayfarerish
Sarun W.
@wayfarerish @dhruvparmar Any plan for isCheer?
Yash Desai
@dhruvparmar Facing this error on POST request Use the access grant code you received through the redirect to request an access token error:"invalid_grant" error_description:"The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."
Yash Desai
Just noticed the starter kit on github, will try it
Yash Desai
@dhruvparmar the starter kit seems to be only for the authorize part, can you please add a get access token sample?
Dhruv Parmar
@yhdesai hey, The "invalid_grant" issue is most likely due to an invalid `code` being used to request the access token. Regarding the starter kit, the get access token part is executed here https://github.com/producthunt/p... once the user authorizes your application. Incase you are looking to build a client only application and do not need users to authorize it you can check out this codesandbox https://codesandbox.io/s/phapi20... as well.
JPEGuin
@dhruvparmar @yhdesai I was facing this issue earlier too, which I resolved through ensuring that the redirect_uri in both the authorise and token calls matched.
Vaibhav Deep
@dhruvparmar @yhdesai @jpeguin1 I am trying the same endpoint using v2 and it still throws this error. The code and redirect_uri are correct. What might be wrong?
Sam Ben
@dhruvparmar Thanks for adding makers and media. Any plans on adding reviews query?
Dhruv Parmar
@ossamaweb we are currently working on internal changes to reviews. They will be added to the API post that.
Evrim Persembe
@dhruvparmar Hey Dhruv. Will you guys support stuff like upvoting, commenting, updating user information, etc. through API v2, or is this Makers Festival only focused on maker goals?
Dhruv Parmar
@evrimfeyyaz Hey, there are no plans to add upvoting or commenting as of now. We would be adding updating user information at a later stage. For now we are focusing on adding write functions related to maker goals.
Evrim Persembe
@dhruvparmar Is it possible to use API v1 for the stuff that are not supported in v2?
Dhruv Parmar
@evrimfeyyaz no since write capabilities in both the versions differ, you would not be able to use v1 endpoints with a v2 application. Also we will soon drop support for v1 API so would be better to build with v2.
Evrim Persembe
@dhruvparmar I would really like to use v2, but unfortunately it is very limited for the idea I had. If you are dropping support for v1 without porting the full functionality to v2, does that mean that many of the apps that were built on v1 will stop working with no way to rewrite them in v2?
Dhruv Parmar
@evrimfeyyaz we would definitely give a time buffer for developers to migrate apps to v2 before dropping support for v1. Also we might consider adding some of v1's write capabilities depending on the use case. As for the Makers festival scope, all apps need to be using v2 API and we wouldn't be adding commenting or upvoting on posts for now.
Vaibhav Singh
@dhruvparmar While trying to retrieve list of product hunt 'Posts' all the 'media' objects are coming as null even though the products have videos or images or both. More Details :-- Here is the query which I fire. Query : To retrieve posts order by votes. { posts (order: VOTES) { edges{ node{ id, name, media{ type, videoUrl } } } } } Result : Trimmed part the the corresponding response. { "data": { "posts": { "edges": [ { { "node": { "id": "76", "name": "Slack", "media": [ { "type": "video", "videoUrl": null }, { "type": "image", "videoUrl": null }, { "type": "image", "videoUrl": null }, { "type": "image", "videoUrl": null }, { "type": "image", .... . . . .
Dhruv Parmar
@vaibhav_soulskill hey, the "videoUrl" specifically only fetches URL for the video if present. Can you try adding "url" field to the "media" object as well? That should give you links to images for all media items. I've tried running the above query and seems there is a bug with "videoUrl" generation in the API. We'll try and patch it up as soon as possible.
Vaibhav Singh
@dhruvparmar Sounds cool, My use-case requires videoUrl so I will be waiting for it.
Dhruv Parmar
@vaibhav_soulskill Hey we've released a fix for the issue. Media items with type='video' should have a valid "videoUrl" now.
Vaibhav Singh
@dhruvparmar Thankyou so much, It works!
Brendan Weinstein
@dhruvparmar the comment section desperately needs to be able to auto scroll!!!
123
•••
Next
Last