Newb: Using OAuth and JSON to get an image?
pcm2a
Registered Users Posts: 21 Big grins
Place me in the newb category and hopefully I didn't miss this when I searched around. I am writing a test program to download one image thumbnail using Java.
What I have so far:
- Using the Java API (uses JSON) I can successfully connect to my account, list my albums, lists my images, and get the image URLs. There is no API that I could find to actually download the image. That is where the image URL comes in.
- If the gallery has external links set to "Yes" then I can use regular http get to pull the image down.
- If the gallery has external links set to "No" I cannot download the image.
So my next step is trying to learn how I can access these private images. Is this where OAuth is going to be required?
Are these the steps others are using to access images?
1. Use JSON (or other available mechanism) to get the image name
2. Use OAuth to authenticate the user
3. Use the OAuth object (instead of a basic http object) to get the image url
I am new to OAuth so I wanted to run that by some pros before going down a wrong path. Thanks!
What I have so far:
- Using the Java API (uses JSON) I can successfully connect to my account, list my albums, lists my images, and get the image URLs. There is no API that I could find to actually download the image. That is where the image URL comes in.
- If the gallery has external links set to "Yes" then I can use regular http get to pull the image down.
- If the gallery has external links set to "No" I cannot download the image.
So my next step is trying to learn how I can access these private images. Is this where OAuth is going to be required?
Are these the steps others are using to access images?
1. Use JSON (or other available mechanism) to get the image name
2. Use OAuth to authenticate the user
3. Use the OAuth object (instead of a basic http object) to get the image url
I am new to OAuth so I wanted to run that by some pros before going down a wrong path. Thanks!
0
Comments
SMSESS=. Once that cookie was set I was able to get the image, no OAuth required.
Cheers,
David
SmugMug API Developer
My Photos