We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I used clj-oauth to successfully login to twitter and fetch access-token. However when I try to invoke twitter api for "https://api.twitter.com/1/account/verify_credentials.json", I am getting a 401.
I suspect the (http/get ... ) is not setting the credentials correctly.
(defn handle-twitter-token-credentials [oauth_token oauth_verifier] {:status 200 :headers {"Content-Type" "text/html"} :body (let [ access-token-response (oauth/access-token consumer request-token oauth_verifier) _ (println " access-token-response: " access-token-response) req-credentials (oauth/credentials consumer (:oauth_token access-token-response) (:oauth_token_secret access-token-response) :GET "https://api.twitter.com/1/account/verify_credentials.json" ) ; this is ok so far _ (println "credentials: " req-credentials) ; this breaks at http/get with 401 . The req-credentials looks ok ; I think http/get is not setting the authorization headers correctly ; info (http/get "https://api.twitter.com/1/account/verify_credentials.json" {:query-params req-credentials}) _ (println "got info ") _ (println "class " (class info)) _ (println (str into)) ] (with-out-str "Ok") )} )
The text was updated successfully, but these errors were encountered:
Hello, thanks for the report. First, you should be using version 1.1 of the Twitter REST API. Please check if that works for you.
Are other authenticated Twitter REST API calls failing with a 401 as well?
Sorry, something went wrong.
I should've tested a little more before commenting. The URL https://api.twitter.com/1/account/verify_credentials.json is for major version 1 and using 1.0 explicitly results in a different error.
Will take a closer look.
No branches or pull requests
I used clj-oauth to successfully login to twitter and fetch access-token. However when I try to invoke twitter api for "https://api.twitter.com/1/account/verify_credentials.json", I am getting a 401.
I suspect the (http/get ... ) is not setting the credentials correctly.
The text was updated successfully, but these errors were encountered: