0

File Transfer API

Hello
I have some confusions about file transfer api.

1. What is ftSessionId and how can we get it.?
2.In file name should I pass path.
3. In file transfer how can we make file notification request?

Still I made request for file transfer (for sending file) but I got the following error.

Error :-The remote server returned an error: (400) Bad Request.


Web Request Data:-

string sendFile_realm = "rcore1.messenger.yahooapis.com/v1/filetransfer/relay";
string url = "http://" + sendFile_realm + "?&sid=" + 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=" + oauth_token;

string postdata = "{\"sendAs\":\"xyz\",\"action\":\"invite\",\"ftSessionId\":\"343258889\" ,\"target\":\"abc\":[{\"files\":{\"fileName\":\"Yahoo Api\",\"fileSize\":\"100\"}}]}";

Kindly help me.

by
4 Replies
  • i am getting error while doing the file transfer invite., if i can get this working, then i can proceed to the next step, of sending the file, or doing accept/decline.

    Please find the request/response that i am doing, and let me know what wrong i am doing.


    Request:

    CODE
    POST http://rcore1.messenger.yahooapis.com/v1/filetransfer/relay?oauth_consumer_key=STRIPPED&oauth_nonce=8fbeb9ab-6ab7-41a8-bf28-aab1afce02d8&oauth_signature=STRIPPED&oauth_signature_method=PLAINTEXT&oauth_timestamp=1297014473&oauth_token=A%3DGzDK662R5zvkUDRNl.ahPQASAU06xiv3hJZwuR9fXK0qpm8EfIQijoh96vsoW9NzWaN6yAXV59VhbY
    MrXKU5FKRKe3NlBuUSmQQJW6lZreEKEU2wIbmI0dFIBohlC9CEKizR7LLNaERP_S05lz_8rNhb3f.MU8i
    zNGTqmrXwkLyeCpcrcAuS_8VLa5ZETE0LbRX59zbvk2PQxmKbQVX6lAeNabw57WpkjRUkyHRXe_qIsDYF
    Naz9Ac99UCrJ2QqS85WWOBrodl6RBO2dPAeFvJyBv0NRjwGDFNUx_GC.Zo2o_Vwf4HVuly_L0e1j3Ar.2
    3zjknarcka7e9rzL0VZXqgmAH6iUszlVWH46ivsOxVHPszM7eGqpwggl6AWTqoEx9T.iO_rRnUm.fmfj0
    A_iz9bBZZqt0T1j4Drh1jugdsiwFgMi3.NRIoyotrtDqhhn2FMFcWZs04PemYDQraPszDJlfztObVWfI3
    4ytwfDJWimVg7lRnLDJKHo9M.sgzbMZ8y1QKdMwadRTj.fDVpbMSx5.2kbDqEzK_a2CdEfyKgrlIQ4mpm
    JJt3y9tKFTh3Oun3IlyIrGbQmkvUa1epboKM0qMcJQHak.GdtTLBy1vbHzxaugFy7n5wfYzfoa8PX6kwi
    kfw9IzIstAb_po93ulNlgKUD.SJ9xJ63CH395GWjch1DsYDs4qbCFdr5W2sbR_r25_LEi.kboQ8MqCh38
    vLMDYq6R0zGDVc1o.UBxBDbn5zbR.NZUYID2wKaQKEta2eJXffJClFKvp4021IlQTzJHS94K.vIkBnTQ2
    CNfQy&oauth_version=1.0&sid=v2hChWPs3RN1VPOCOv3iEZDLv3p764g5fir9EQ-- HTTP/1.1
    Content-Type: application/json; charset=utf-8
    Host: rcore1.messenger.yahooapis.com
    Content-Length: 146
    Expect: 100-continue

    {"sendAs":"vrindirnd","action":"invite","ftSessionId":"FILE-TO-TRANSFER","target":"patelharshilb","files":[{"fileName":"file.xml","fileSize":65}]}



    Response:
    CODE
    HTTP/1.1 403 Forbidden
    Date: Sun, 06 Feb 2011 17:46:19 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: public,must-revalidate
    content-length: 110
    content-type: application/json;charset=utf-8
    Vary: Accept-Encoding
    Connection: close

    {"error":{"code":-1009,"detail":"Capability Check Error","description":"Capability Check Error"},"code":-1009}
    0
  • i got the exact error....did you resolved the problem?
    0
  • Hello,

    Hello,

    Try this code .

    string sessions_realm = "developer.messenger.yahooapis.com/v1/session";

    string postdatas = "{\"presenceState\":0,\"presenceMessage\":\"my login status message\",\"clientCapabilities\":[{\"clientCapability\":\"fileXfer\"}]}";

    string urls = "http://" + sessions_realm + "?&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=" + oauth_token;

    string fileSessionId_request = fetchURL(urls, true, postdatas);

    Thanks



    QUOTE (infoslast @ Feb 25 2011, 03:53 AM) <{POST_SNAPBACK}>
    i got the exact error....did you resolved the problem?
    0
  • hi,

    If in the filename "fileName\":\"Yahoo Api\",\" I send just the name of the file , where will I send the path of the filename?

    Thx
    0

Recent Posts

in Messenger IM SDK