0

buddy request

I have implemented method buddy request. I am getting error 405. Can anyone tell me why? How can I do to respond to buddy request only? ( meaning if I don;t want to add buddies, only to respond to their request. I am using c#

by
8 Replies
  • Hello,

    In Buddylist Authorization Management APIs, you can either accept or deny request.If u don't want to add contact then you have to use delete method.

    Try the following code:-

    string method = "Delete";
    string Id = requestMember.Sender;
    string presence_realm = log.Server + "/v1/buddyrequest/yahoo/" + Id;
    string postdata = "{}";
    string url = "http://" + presence_realm + "?&sid=" + log.SessionId + "&oauth_consumer_key=" + oauth_consumer_key + "&oauth_signature_method=" +
    oauth_signature_method + "&oauth_nonce=" + oauth_nonce + "&oauth_timestamp=" + oauth_timestamp + "&oauth_signature=" + oauth_signature +
    "&oauth_version=" + oauth_version + "&oauth_token=" + log.oauth_token;
    string sessionid_request = fetchURL(url, true, postdata, method);


    Thanks
    QUOTE (infoslast @ Feb 24 2011, 04:19 AM) <{POST_SNAPBACK}>
    I have implemented method buddy request. I am getting error 405. Can anyone tell me why? How can I do to respond to buddy request only? ( meaning if I don;t want to add buddies, only to respond to their request. I am using c#
    0
  • QUOTE (infoslast @ Feb 24 2011, 04:19 AM) <{POST_SNAPBACK}>
    I have implemented method buddy request. I am getting error 405. Can anyone tell me why? How can I do to respond to buddy request only? ( meaning if I don;t want to add buddies, only to respond to their request. I am using c#

    The method is exactly the one as add_contact from php, only the url is url_BuddyRequest, the method id post ( as lowercase).
    Url is tring uri = URL_YM_BUDDYREQUEST +
    "?oauth_consumer_key=" + CONSUMER_KEY +
    "&oauth_nonce=" + randNo.ToString() +
    "&oauth_signature=" + SECRET_KEY + "%26" + OAUTH_TOKEN_SECRET +
    "&oauth_signature_method=PLAINTEXT" +
    "&oauth_timestamp=" + DateTime.Now +
    "&oauth_token=" + OAUTH_TOKEN +
    "&oauth_version=1.0" +
    "&sid=" + SESSION_ID;
    and Only have a http request. Why I cannot respond to a contact request? The function doesn';t do anything....
    0
  • Hello,

    Did u use delete method of "HttpWebRequest".I didn't see in your code.

    Thanks

    QUOTE (infoslast @ Feb 24 2011, 04:54 AM) <{POST_SNAPBACK}>
    The method is exactly the one as add_contact from php, only the url is url_BuddyRequest, the method id post ( as lowercase).
    Url is tring uri = URL_YM_BUDDYREQUEST +
    "?oauth_consumer_key=" + CONSUMER_KEY +
    "&oauth_nonce=" + randNo.ToString() +
    "&oauth_signature=" + SECRET_KEY + "%26" + OAUTH_TOKEN_SECRET +
    "&oauth_signature_method=PLAINTEXT" +
    "&oauth_timestamp=" + DateTime.Now +
    "&oauth_token=" + OAUTH_TOKEN +
    "&oauth_version=1.0" +
    "&sid=" + SESSION_ID;
    and Only have a http request. Why I cannot respond to a contact request? The function doesn';t do anything....
    0
  • QUOTE (jainpragya88 @ Feb 24 2011, 05:01 AM) <{POST_SNAPBACK}>
    Hello,

    Did u use delete method of "HttpWebRequest".I didn't see in your code.

    Thanks

    yes, i used http web request like this:

    HttpWebRequest x = WebRequest.Create(uri) as HttpWebRequest;
    x.ContentType = "application/json;charset=utf-8";
    string postData = "{ \"authReason\" :\"" + reason + "\"}";
    UTF8Encoding encoder = new UTF8Encoding();
    byte[] bytes = encoder.GetBytes(postData);
    x.ContentLength = postData.Length;
    x.Method = method.ToLower();
    after that i used stream and do stream.write(bytes, 0, bytes.length). I used the code from php, response_contact. what is not ok?
    0
  • Hello,

    If you will send blank( post data="{}") then what will happen?

    Thanks




    QUOTE (infoslast @ Feb 24 2011, 05:10 AM) <{POST_SNAPBACK}>
    yes, i used http web request like this:

    HttpWebRequest x = WebRequest.Create(uri) as HttpWebRequest;
    x.ContentType = "application/json;charset=utf-8";
    string postData = "{ \"authReason\" :\"" + reason + "\"}";
    UTF8Encoding encoder = new UTF8Encoding();
    byte[] bytes = encoder.GetBytes(postData);
    x.ContentLength = postData.Length;
    x.Method = method.ToLower();
    after that i used stream and do stream.write(bytes, 0, bytes.length). I used the code from php, response_contact. what is not ok?
    0
  • Nothing happenes. If I also put webresponse, it return "" ( nothing). Nothing happens . Really need help with this, please.
    Thhe add_contact works. But buddy_request it doesn;t work. Do you know why?
    0
  • 0
  • Hello,

    Session management API gives server name (rcore1.messenger.yahooapis.com) that server name you have to use.

    Thanks


    QUOTE (infoslast @ Feb 24 2011, 05:36 AM) <{POST_SNAPBACK}>
    what do you use as the server? http://rcore1.messenger.yahooapis.com/v1/b.../yahoo/{{USER}} this? or http://developer.messenger....?
    0

Recent Posts

in Messenger IM SDK