How to upload to imgur user account

I can upload anonymous images to imgur using api as follows:

public static void UploadImage()
{
    Image image = GetImage();
    string base64 = Util.ImageToBase64(image);

    using (WebClient client = new WebClient())
    {
        client.Headers.Add("Authorization", "Client-ID " + clientID);

        NameValueCollection data = new NameValueCollection();
        data["image"] = base64;
        data["type"] = "base64";

        byte[] responsePayload = client.UploadValues("https://api.imgur.com/3/image/", "POST", data);
        string response = Encoding.ASCII.GetString(responsePayload);
    }
}

It loads a completely arbitrary URL. I could not find the documentation that showed how to do this, but is it possible to upload the image to the user account so that it appears in their uploaded images?

0
source share
2 answers

. "CLIENT-ID" "BEARER" , imgur oauth 2 api, , , . :

client.Headers.Add("Authorization", "BEARER " + accessToken);
0

... , imgur python , BEARER .

req.add_header("Authorization", "Bearer " + imgur_access_token)
0

Source: https://habr.com/ru/post/1544109/


All Articles