Jake Rocheleau Jake Rocheleau - 1 year ago 174
jQuery Question

Using jQuery to Anonymous Upload image(s) onto Imgur API v3?

I have been looking through various posts on Stack which eventually lead me to this thread which focuses on PHP uploads.

I am familiar with accessing APIs but generally over PHP. I recognize that some if not most API calls will require a backend system. But I am curious if it is possible to create an API call to upload onto Imgur strictly using jQuery? No other backend like Python or RoR or PHP or anything?

My current client ID is used for anonymous upload so there is no OAuth or any other connection. I can get this working in PHP but I would love to make the application Ajax-based without refreshing the page. Any steps in the right direction would be more than appreciated.

Answer Source

v2 works for me

    var imageData = "base64 encoded data here";

    $.post("http://api.imgur.com/2/upload", {key:"your_api_key", type:"file", image:imageData}, function(page)

I just tested this and it uploaded my image