producthunt / producthunt-api

Product Hunt API
316 stars 29 forks source link

Problem with clientonly authentication #109

Closed abunsen closed 7 years ago

abunsen commented 7 years ago

Hello please see the following output from my curl requests:

curl -d "client_id=<client_id_was_here>&client_secret=<client_secret_was_here>&grant_type=client_credentials" -X POST https://api.producthunt.com/v1/oauth/token

{"access_token":"75e023cf0d711ee43afd7eca37db44a37b3278bbd889a97ef507aef2c46dfd55","token_type":"bearer","scope":"public"}

$ curl -H 'Authorization: 75e023cf0d711ee43afd7eca37db44a37b3278bbd889a97ef507aef2c46dfd55' https://api.producthunt.com/v1/posts

{"error":"unauthorized_oauth","error_description":"Please supply a valid access token. Refer to our api documentation about how to authorize an api request. Please also make sure you require the correct scopes. Eg \"private public\" for to access private endpoints."}

Am I supposed to get that? I just wanted to fetch all the posts.

andreasklinger commented 7 years ago

Authorization: Bearer <your_access_token>

andreasklinger commented 7 years ago

most likely that's the trouble

andreasklinger commented 7 years ago

if not feel free to reopen 👍