Closed joshcanhelp closed 1 month ago
Tried curl and got tokens:
curl -X POST https://www.reddit.com/api/v1/access_token \
-H "Authorization: Basic CORRECT_CREDENTIALS_BASE64_ENCODED" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "User-Agent: curl" \
-d "grant_type=authorization_code&code=AUTH_CODE&redirect_uri=https://localhost:8889"
... but cannot get the script call to work.
There is a Reddit handler written and ready to go:
https://github.com/PersonalDataPipeline/pdpl-cli/tree/main/src/apis/reddit
The documentation for API authentication is, sadly, quite thin. Using the links saved in the API README, I tried using basic OAuth2 to get a token:
The consent window appeared as expected:
... but the auth code exchange did not work:
Data sent is:
And the headers: