I can create albums, using the requests and oauth-hook modules just fine, but I can’t seem to get a name working. Check out the docs here: http://api.imgur.com/resources_auth#account_albums . I’m using Windows7x64 Python2.7, requests version 0.21.1 and oauth-hook version 0.4.0
Strangely, using the same approach to name an image when I upload it, the script works just fine. Here’s the relevant code:
client = requests.session(hooks={'pre_request': authorizedHook})
url = r'http://api.imgur.com/2/account/albums.json'
parameters = {'title': 'ALBUMTITLEHERE'}
r = client.post(url, data=parameters)
which returns something like this, once I load it into json:
Created Album data:
{u'albums': {u'anonymous_link': u'http://imgur.com/a/i3Gal',
u'cover': u'',
u'datetime': u'2012-05-24 02:34:42',
u'description': u'',
u'id': u'i3Gal',
u'layout': u'blog',
u'link': u'http://tankorsmash.imgur.com/1B498',
u'order': 0,
u'privacy': u'public',
u'title': u''}}
What I was expecting was a named gallery called ALBUMTITLEHERE. But created an untitled one instead. What am I doing wrong?
Unrelated: The Stats API doesn’t seem to be returning anything at all for me, but I’m not sure that’s relevant.
Edit:
I’ve tried it myself now for quite some time, tried nearly every possible combination of parameters sent as http url parameter, post (json, urlencoded, even xml)… even analyzed raw requests in wireshark – everything works as it should.
But no luck, it doesn’t work.
I’m quite sure this is a bug in the API itself. It’s also impossible to change the title of an existing album.
So my previous response doesn’t apply.