When I upload an image to Imgur, it goes to my account; even in the album I specify but stays hidden.
I went to https://apidocs.imgur.com/
It makes me open postman, I did tests.
I selected "POST IMAGE UPLOAD"
I insert in Header section Authorization Bearer {{token}}
The album hash, title, description.
It gives me this code:
<?php
$request = new HttpRequest();
$request->setUrl('https://api.imgur.com/3/image');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders(array(
'Postman-Token' => 'dbbf023e-642e-493a-9fe2-e57f61680068',
'cache-control' => 'no-cache',
'Content-Type' => 'application/x-www-form-urlencoded',
'Authorization' => 'Bearer {{token}}',
'content-type' => 'multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW'
));
$request->setBody('------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"
R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="album"
ZTgISJ7
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="title"
title test
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="description"
descri
------WebKitFormBoundary7MA4YWxkTrZu0gW
Content-Disposition: form-data; name="image"
{{umg url}}
------WebKitFormBoundary7MA4YWxkTrZu0gW--');
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
But no matter what I try, the image stays hidden.
Is it possible to upload an image via this method and the image becomes a public post? (By public post I mean the button called "Share to community")
Thanks.