I'm trying to connect to the StackExchange API in R.
When I try:
library(httr)
end <- oauth_endpoint(authorize = "https://stackoverflow.com/oauth",
access = "https://stackoverflow.com/oauth")
myapp <- oauth_app("myapp",
key = "KEY", # tried swapping these
secret = "CLIENT SECRET",
redirect_uri = "https://stackoverflow.com/oauth/login_success")
token <- oauth2.0_token(end,
myapp)
The browser opens but leads to the following message (in the browser):
Couldn't parse `client_id`
This also happens if I try it with opposite (reversed) values of key
and secret
, or event with key
set to either value and secret=NULL
(just to test without privileged access).
The StackExchange API docs say that the key
value they give you is not really a secret but the client_secret
value is. In the oauth_app
help it says that the secret
"is not equivalent to a password, and is not really a secret". Interesting.
For now I'm just trying to establish an initial test connection.
Update:
I was curious if it was actually a matter of not being able to parse special character. I tried escaping the 2 parentheses (((
) in my key and client_secret. That didn't change anything. I then tried setting both to an empty string (i.e. key = ""
, etc) and yet that somehow led to the same result. I feel it's a clue but I still don't know what's wrong.