views:

74

answers:

1

I am trying to upload a photo from an Adobe AIR application to yfrog's api, http://code.google.com/p/imageshackapi/wiki/YFROGuploadAndPost. I have the following code:

public function upload(file:File, msg:String, username:String, password:String):void {
    var vars:URLVariables = new URLVariables();
    vars["username"] = username;
    vars["password"] = password;
    vars["public"] = "yes";
    vars["key"] = API_KEY; //API_KEY is a constant string that holds my developer key
    vars["message"] = msg;

    var request:URLRequest = new URLRequest("http://yfrog.com/api/uploadAndPost");
    request.method = URLRequestMethod.POST;
    request.contentType = "multipart/form-data";
    request.data = vars;


    file.upload(request, "media");
}

When I run this code, yfrog returns 404 status. This seems to only happen if I do a media file upload with the api. If I use a "url" upload to the same api url - everything works. Has anyone else gotten a "media" file upload to work? If so, how would you change the code?

A: 

Looks like that API has been replaced as of today with the OAuth Echo method

http://code.google.com/p/imageshackapi/wiki/TwitterAuthentication

John W.