0

Session Management

I try to make my own Yahoo Messenger...
I've read step by step of the yahoo messenger IM SDK...

I've succed to get request_toke, and oauth_token_secret
My problem is when I want to create session...
I dont know how to send this request using DELPHI 7 with TIdHTTP:
/----
POST /v1/session
Host: developer.messenger.yahooapis.com
Authorization: < Standard OAuth credentials >
Content-Type: application/json;charset=utf-8
Content-Length: 2
{
}
---/
i try to input it via IdHttp.CustomHeader, but always show this error msg: "HTTP/1.1 401 Authorization Required"

When I put the parameter via Tstringlist, then I execute them with tIdTHHP.post(URL,TstringList), it always show this error: "HTTP/1.1 501 OAuth Parameter Transmission Not Supported"

What is the meaning of "Standard OAuth credentials" above?

Anyone can help me, pleeaseeeee.....
[krishnamurti]

by
5 Replies
  • hello can u tell me how to start with api to login in messenger.

    thankx in advance plz reply
    0
  • QUOTE (meskey @ Jul 21 2010, 09:03 PM) <{POST_SNAPBACK}>
    I try to make my own Yahoo Messenger...
    I've read step by step of the yahoo messenger IM SDK...

    I've succed to get request_toke, and oauth_token_secret
    My problem is when I want to create session...
    I dont know how to send this request using DELPHI 7 with TIdHTTP:
    /----
    POST /v1/session
    Host: developer.messenger.yahooapis.com
    Authorization: < Standard OAuth credentials >
    Content-Type: application/json;charset=utf-8
    Content-Length: 2
    {
    }
    ---/
    i try to input it via IdHttp.CustomHeader, but always show this error msg: "HTTP/1.1 401 Authorization Required"

    When I put the parameter via Tstringlist, then I execute them with tIdTHHP.post(URL,TstringList), it always show this error: "HTTP/1.1 501 OAuth Parameter Transmission Not Supported"

    What is the meaning of "Standard OAuth credentials" above?

    Anyone can help me, pleeaseeeee.....
    [krishnamurti]



    hi,
    checkout this page: http://developer.yahoo.com/messenger/guide/ch01s03.html

    CMIIW, what "Authorization" field required is something like on Example 1.1 (line 2 - 10)
    We need to sent this header for each request.
    (and maybe many more header, as User-Agent string, etc.)
    0
  • QUOTE (meskey @ Jul 21 2010, 09:03 PM) <{POST_SNAPBACK}>
    I try to make my own Yahoo Messenger...
    I've read step by step of the yahoo messenger IM SDK...

    I've succed to get request_toke, and oauth_token_secret
    My problem is when I want to create session...
    I dont know how to send this request using DELPHI 7 with TIdHTTP:
    /----
    POST /v1/session
    Host: developer.messenger.yahooapis.com
    Authorization: < Standard OAuth credentials >
    Content-Type: application/json;charset=utf-8
    Content-Length: 2
    {
    }
    ---/
    i try to input it via IdHttp.CustomHeader, but always show this error msg: "HTTP/1.1 401 Authorization Required"

    When I put the parameter via Tstringlist, then I execute them with tIdTHHP.post(URL,TstringList), it always show this error: "HTTP/1.1 501 OAuth Parameter Transmission Not Supported"

    What is the meaning of "Standard OAuth credentials" above?

    Anyone can help me, pleeaseeeee.....
    [krishnamurti]


    I use the HTTP Debugger Pro to analyze the login Yahoo Messenger step by step


    STEP 1 (Request PART)

    REQUEST STREAM:

    GET /WSLogin/V1/get_auth_token?&login=myymid&passwd=myympass&oauth_consumer_key=dj0yJmk9VHZoOTdVajdPOFgzJmQ9WVdrOVpGbzBZV0YzTldrbWNHbzlNV
    EkzTXpnMk9EUTJNZy0tJnM9Y29uc3VtZXJzZWNyZXQmeD00ZA-- HTTP/1.1
    Host: login.yahoo.com
    Connection: Keep-Alive

    RESPONSE STREAM:

    HTTP/1.1 200 OK
    Date: Mon, 09 Aug 2010 01:11:04 GMT
    P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    Cache-Control: private
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/plain

    RequestToken=OIC_cldu3AbhdSZ_zRLAz.kb0eUD_XLLEVMdqhHrkpXxdrgEULB4pkv0T3jdurl3Et.
    BcRKHmTVMwyuqXWJqsk_ZKwaliS1Ib7.EY94YZD8e.vDS0fgh9.NyIIQKlFkNnFWQfMRfBuDgkCYIzd9z
    WcruKL6ZQIG33eX5GxT9gKhZRz.1OWGp1NlGyAjQ0Rf7QFamGOI.CC_6ZjEXgg8FhAW86z9n9LHHsNU-

    STEP 2 (Request Access Token and Access Session)

    REQUEST STREAM:

    GET /oauth/v2/get_token HTTP/1.1
    Authorization: OAuth realm="yahooapis.com",oauth_consumer_key="dj0yJmk9VHZoOTdVajdPOFgzJmQ9WVdrOVpGbzBZV0YzTldrbWNHbzlNVEkzTXpnMk9EUTJNZy0
    tJnM9Y29uc3VtZXJzZWNyZXQmeD00ZA--", oauth_token="OIC_cldu3AbhdSZ_zRLAz.kb0eUD_XLLEVMdqhHrkpXxdrgEULB4pkv0T3jdurl3Et.BcRKHmTV
    MwyuqXWJqsk_ZKwaliS1Ib7.EY94YZD8e.vDS0fgh9.NyIIQKlFkNnFWQfMRfBuDgkCYIzd9zWcruKL6Z
    QIG33eX5GxT9gKhZRz.1OWGp1NlGyAjQ0Rf7QFamGOI.CC_6ZjEXgg8FhAW86z9n9LHHsNU-", oauth_signature_method="PLAINTEXT", oauth_signature="0ca1124eda008851bbf38e1c08261e671536da08%26", oauth_timestamp="1281316262", oauth_nonce="323039061", oauth_version="1.0"
    Host: api.login.yahoo.com
    Connection: Keep-Alive

    RESPONSE STREAM:

    HTTP/1.1 200 OK
    Date: Mon, 09 Aug 2010 01:11:07 GMT
    P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    Connection: close
    Transfer-Encoding: chunked
    Content-Type: text/plain; charset=utf-8

    oauth_token=A%3DdwA3glOarlvsZY1GMv2qDajRqjsNsyeU9HgescF1RFw3ZkXD10TaKJCy3BliNF.Etc73dToWrYlzKN
    _yZMhV0bI3CPvtvAnWDpmF8OCkmE_2aV8mqW0tzIpAYr6I4N1VZWxjOp9URrvWZetNmEGFZGeNJjgNdaG
    VtMQrHxyunoINV2Wd6RohnkvGxC8HkofZfM5Ajpjo885CNCRLJ2XSnjzLN3Q7sas_o3x1bk39JYQJt0XT
    srCmxPbeg74JquHbrCoOMhfyMvSuWB.OhVw0E.QP8y8fr8jbghbaAwgJtuD7IeJDX.jY4Hd4EjBa9494l
    v.FcUYSFcVHH_5l9ZqPtRaP3NTtCno0ovJlQp6yffiY7537RaYcqexs8FadWmaocaVvuq7jgDDK_mvJnu
    gHjJPeomiVieekPKEwrTVvL63PilMyntRqVx.zKbd301pF0G_rysjh31otXQfDfS1cruSZ6iEsWCXTOEZ
    mII5drWrKdKZIXGHp0e3duMho79AVItVgDwLA75Pg7vucpZ.IqfYaL7GYrlsOQTRnf6xRc1mk6erePP.L
    Tg_opgCd_IAZ6trwrNsA6hrEXRustv8ujfHzCBSw9ckkkyzu._p_lDOR2L8.h9wiKWYLB62ranEXAyOYg
    QszwHZKxgNg2r94q_HYPvgFsYBtVgNWO5JfhPj3h8ljun7O45v_1HBwFjz.S34At3zCJhX6wcQfSKT9af
    7I5PYq9RgIF7fn2VEGOJip24yyajsnCk_oEvD8RCZTwoSej01u&oauth_token_secret=cd0d618a8db13dc5be0334d511dfc2f755277c26&oauth_expires_in=3600&oauth_session_handle=AFSAW0yFwcnP1UwoEBxR_El_A7duVdMbeQ5xzx4dl.6dM2xjoPM-&oauth_authorization_expires_in=866167380&xoauth_yahoo_guid=MM3MF2Q6EWNZZ4J2EH7B7WTXQE


    STEP 3 (Invoke messenger API using Access Token)

    REQUEST STREAM:

    POST /v1/session/?notifyServerToken=1 HTTP/1.1
    Authorization: OAuth realm="yahooapis.com", oauth_consumer_key="dj0yJmk9VHZoOTdVajdPOFgzJmQ9WVdrOVpGbzBZV0YzTldrbWNHbzlNVEkzTXpnMk9EUTJNZy0
    tJnM9Y29uc3VtZXJzZWNyZXQmeD00ZA--", oauth_nonce="130972080", oauth_signature_method="PLAINTEXT", oauth_timestamp="1281316265", oauth_token="A%3DdwA3glOarlvsZY1GMv2qDajRqjsNsyeU9HgescF1RFw3ZkXD10TaKJCy3BliNF.Etc73dToWrYlzKN
    _yZMhV0bI3CPvtvAnWDpmF8OCkmE_2aV8mqW0tzIpAYr6I4N1VZWxjOp9URrvWZetNmEGFZGeNJjgNdaG
    VtMQrHxyunoINV2Wd6RohnkvGxC8HkofZfM5Ajpjo885CNCRLJ2XSnjzLN3Q7sas_o3x1bk39JYQJt0XT
    srCmxPbeg74JquHbrCoOMhfyMvSuWB.OhVw0E.QP8y8fr8jbghbaAwgJtuD7IeJDX.jY4Hd4EjBa9494l
    v.FcUYSFcVHH_5l9ZqPtRaP3NTtCno0ovJlQp6yffiY7537RaYcqexs8FadWmaocaVvuq7jgDDK_mvJnu
    gHjJPeomiVieekPKEwrTVvL63PilMyntRqVx.zKbd301pF0G_rysjh31otXQfDfS1cruSZ6iEsWCXTOEZ
    mII5drWrKdKZIXGHp0e3duMho79AVItVgDwLA75Pg7vucpZ.IqfYaL7GYrlsOQTRnf6xRc1mk6erePP.L
    Tg_opgCd_IAZ6trwrNsA6hrEXRustv8ujfHzCBSw9ckkkyzu._p_lDOR2L8.h9wiKWYLB62ranEXAyOYg
    QszwHZKxgNg2r94q_HYPvgFsYBtVgNWO5JfhPj3h8ljun7O45v_1HBwFjz.S34At3zCJhX6wcQfSKT9af
    7I5PYq9RgIF7fn2VEGOJip24yyajsnCk_oEvD8RCZTwoSej01u", oauth_version="1.0", oauth_signature="0ca1124eda008851bbf38e1c08261e671536da08%26cd0d618a8db13dc5be0334d511dfc2f755277c26"
    Content-Type: application/json;charset=utf-8
    Host: developer.messenger.yahooapis.com
    Content-Length: 2
    Connection: Keep-Alive

    {}

    RESPONSE STREAM:

    HTTP/1.1 200 OK
    Date: Mon, 09 Aug 2010 01:11:10 GMT
    P3P: policyref="http://info.yahoo.com/w3c/p3p.xml", CP="CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE LOC GOV"
    cache-control: private,must-revalidate
    content-length: 238
    content-type: application/json;charset=utf-8
    set-cookie: IM=2LZrSs4TOU9MishgAh9K04cjPlezfd4OiAVdapZVueTDZG2sA2ZvESQ_3lMjHHnkr9YhLHxN2_0Ok
    CA--|3XW77aYEY7tYrRq3avE2FA--; expires=Mon, 09-Aug-2010 02:11:10 GMT; path=/; domain=.messenger.yahooapis.com
    Vary: Accept-Encoding
    Connection: close

    {"sessionId":"gFmWq0Ls3RLri_U0lm1mlKxIBFinpMga5yo-","primaryLoginId":"myymid","displayInfo":{"avatarPreference":"2","checksum":"-1035057348"},"server":"rcore1.messenger.yahooapis.com","notifyServer":"rproxy1.messenger.yahooapis.com"}
    0
  • QUOTE (meskey @ Jul 21 2010, 09:03 PM) <{POST_SNAPBACK}>
    When I put the parameter via Tstringlist, then I execute them with tIdTHHP.post(URL,TstringList), it always show this error: "HTTP/1.1 501 OAuth Parameter Transmission Not Supported"

    What is the meaning of "Standard OAuth credentials" above?

    Anyone can help me, pleeaseeeee.....
    [krishnamurti]


    You just almost there. After you get 501 error, add this line into your http header:
    Content-type: application/json; charset=utf-8

    Thx
    ~jimmi
    0
  • lot of people getting stuck at the same place. session management. after doing everything successfully, getting stuck at session management. documentation can be improved!!
    0

Recent Posts

in Messenger IM SDK