PDA

View Full Version : How to get an Image Url with JSON?


pcm2a
Jul-22-2010, 12:02 PM
The documentation is clear (and easy to use) on how to login, list albums, list images, get image urls. I'm stalling out trying to actually get an image, if it is a private one.

- Login with username/password and get session id
- List private (no external link) images
- Get image url

Now I have a url that you can't just do a normal get on, since it is protected. I need to use my session id, apikey, etc to get the image.

Instead of http://username.smugmug.com/photos/12345-x.jpg which returns a 404 error I need maybe something like:

http://api.smugmug.com/hack/json/1.2.0/?APIKey=key&SESSION=session&method=smugmug.get.url&image=whatever.

I'm sure I'm missing something simple here....

pcm2a
Jul-22-2010, 12:19 PM
Nevermind, I have figured it out. The key peice of information that didn't seem to be in the documentation was how to set a cookie with the session id.

SMSESS=<session id>. Once that cookie was set I was able to get the image, no OAuth required.

Sorry for two threads about the same thing. I don't see a way to delete.