0

Error while making OAuth Yahoo! API Requests.

Facing the same issue since 2 days.. I have gone through 4 steps of OAuth. But when I'm trying to continue with which is given here http://developer.yahoo.com/oauth/guide/oauth-make-request.html

String yahoo_API_request_url = "http://social.yahooapis.com/v1/user/" xoauth_yahoo_guid "/profile?format=json&"
                  "realm=yahooapis.com"
                  "&oauth_consumer_key="
                  oauth_consumer_key
                  "&oauth_nonce="
                  oauth_nonce
                  "&oauth_signature_method=HMAC-SHA1"
                  "&oauth_timestamp="
                  (System.currentTimeMillis()   600)
                  "&oauth_token="
                  oauth_token
                  "&oauth_version="
                  oauth_version
                  "&oauth_signature=5934d83aee733bf51879bee56fd4834%3D";
        url = new URL(yahoo_API_request_url);
        conn = url.openConnection();
        // Get the response
        rd = new BufferedReader(new InputStreamReader(conn
                .getInputStream()));

after this I'm getting ~~~ Server returned HTTP response code: 401 for URL: http://social.yahooapis.com/v1/user/QUDCNAIRCLFGXNDO6SCFQ/profile?format=json&realm=yahooapis.com&oauth_consumer_key=dj0yJmk9a0U5tNU1Oa1pUTnpZbWNHbzlNakE1TURZek5qQTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD1mYg--&oauth_nonce=ce2130314ed3965ea6&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1355392416080&oauth_token=A%3D4br4nzjt6hYa3qwZ08ACrQYgXMQhBexcP ~~~ Where I'm doing wrong? Please help.

by
2 Replies
  • I tried many things.. worked around and again stuck. Now for the same OAuth Yahoo! API Requests (step 5 at http://developer.yahoo.com/oauth/guide/oauth-make-request.html) I'm getting {"error": {"lang":"en-US","description":"Please provide valid credentials. OAuth oauth_problem=\"timestamp_refused\", realm=\"yahooapis.com\""}}

    this error. While oauth_timestamp I have set to (System.currentTimeMillis(); 600).

    Please help!

    0
  • time stamp should be unix epoch timestamp in seconds

    if you are trying it in android timestamp = system.currenttimeinmillies()/1000L;

    but i recomend u to use this api

    https://github.com/fernandezpablo85/scribe-java

    its very easy to use.

    0

Recent Posts

in Contacts