Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image upload error #1

Closed
usuthu65 opened this issue Jul 6, 2011 · 1 comment
Closed

Image upload error #1

usuthu65 opened this issue Jul 6, 2011 · 1 comment

Comments

@usuthu65
Copy link

usuthu65 commented Jul 6, 2011

The following code returns an error when attempting to upload an image:

from smugpy import SmugMug

API_KEY = "legal_api_key_here"

smugmug = SmugMug(api_key=API_KEY, app_name="pje_uploader")
smugmug.login_withPassword(EmailAddress="email_here", Password="password_here")

ret = smugmug.albums_create(Title="API Test 5")
smugmug.images_upload(AlbumID=ret['Album']['id'],File='/Path/To/Image.jpg',Caption='Test caption')

The JSON response from the server when I print it out is:
{u'stat': u'fail', u'code': 1, u'message': u"We're sorry, but you don't appear to be logged in to that account. Please login and try again."}

What am I doing wrong or is this a real bug? I thought my call to "login_withPassword" was fine and it returns OK values. The albums_create() method works as well and the new album shows up in the web view of the account. The images_upload() method takes a while (so obviously it's sending the image), but then I get the error shown and the image never shows up.

Thanks!

@chrishoffman
Copy link
Owner

I fixed the issue. It looks like the session was not set correctly in upload. Thanks for reporting the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants