• Gear
  • Shots
  • Photo Craft
  • Video
  • Wide Angle
  • Support
  • New Stuff
  • More
Support SmugMug APIs, Hacks & Tricks new API release - Mar 4, 2005

FAQtoid

Ever wanted to create an Avatar? Creating an Avatar!

Searching Dgrin with Google Searching with Google

Dgrin Challenges

Congratulations to the Winner of DSS #128 (Sunrise or Sunset), ShootingStar.

The next Dgrin Challenge DSS #129 (Silhouette Revisited ) is open for entries through May 27th, 2013 at 8:00pm PDT.

As always, we look forward to your participation but please do take a moment to read through the rules before posting your entry.

Past DSS Challenge Winners, DSS Challenge Rules, and other important DSS Challenge information is here.

Need some help with Accessories?

Tutorials

Ever find yourself wondering just how someone managed to create an image using different effects?

Here are three simple tutorials we hope will encourage you to try something new.

The Hot Seat

A lifelong interest in landscape photography has led Eyal Oren to make a study of his adopted hometown of Marblehead, MA. As you can see, his dedication is paying off!

Africa!

Dgrinners Harryb, Pathfinder, and others joined Andy Williams and Marc Muench on Safari in East Africa recently. Here are some awesome threads to check out!

 
Thread Tools Display Modes
Page 1  of  3
1 2 3
Old Mar-04-2005, 01:29 PM
#1
onethumb is offline onethumb OP
SmugMug CEO & Chief Geek
onethumb's Avatar
new API release - Mar 4, 2005
Just rolled out a new API maint release. Mainly bug fixes, but a couple of new things too:

- NEW URL TO POST TO: api.smugmug.com/xmlrpc ... old URL will continue to work, but use the new one for all new releases. For uploads, continue to post to upload.smugmug.com.

- anonymous bug found and erradicated. should be able to do all the anonymous calls, but of course, let me know if not.

- changeAlbumSettings fixed.

- getImageURLs empty Original/Larges fixed

- getImages now orders ImageIDs by your chosen sortmethod.

- documentation errors and typos fixed

- getImages now takes a 3rd optional parameter, "TemplateID", so we can build the proper (new) AlbumURL for you. Generally, I'd leave this blank, but it's there just in case you're sure someone is using a non-Elegant template.

- getAccountType returns "Pro", "Power", and "Standard" for the logged in user. Should make your UIs a little nicer since you don't have to ask your users what they have.

- getAlbumTemplates will give you all the details on a users's album templates, which, of course, you can then use when creating an album instead of sending all the details. Your call.

- updated and added URLs to the known apps/scripts/etc. Holler if yours is missing or wrong.

That should do it. Enjoy, and cross your fingers that I didn't break anything. :)

Don
Old Mar-04-2005, 02:03 PM
#2
onethumb is offline onethumb OP
SmugMug CEO & Chief Geek
onethumb's Avatar
Quote:
Originally Posted by onethumb
- NEW URL TO POST TO: api.smugmug.com/xmlrpc ... old URL will continue to work, but use the new one for all new releases. For uploads, continue to post to upload.smugmug.com.
Just in case that wasn't clear enough, *only* the actual binary photo uploads should be POSTed to upload.smugmug.com. All other operations during your "upload" such as logging in and stuff should be sent to api.smugmug.com.

Clear as mud?

Don
Old Mar-04-2005, 02:03 PM
#3
Aaron Christy is offline Aaron Christy
Last in line for pie
Quote:
Originally Posted by onethumb
Just rolled out a new API maint release.
Don,

(breathing rapidly into a paper bag) Thank you, thank you, thank you.

I'll give it a go tonight (although I'm sure there are a few other people that will beat me to it ... I can't believe that Nik hasn't responded yet).

I'll let you know if I find anything.
Old Mar-04-2005, 02:09 PM
#4
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Thank you!
I guess I'll have a fun weekend changing SE..
Seriously, very glad you finally had a chance to fix the stuff..
---

Guys, let's post your quick findings and confirmations here, so we don't all have to spend time over simple things, like what works and what not..

----

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 04:34 PM
#5
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Since you've asked...
Quote:
Originally Posted by onethumb
- updated and added URLs to the known apps/scripts/etc. Holler if yours is missing or wrong.
In the apps section:
  • is it possible to change the formatting in a way it does NOT depict everybody else as a plugin to SendtoSmugmug?
  • I personally would appreciate if you set the order to alphabetical or chronological (FIFO)..
Thank you!

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 04:38 PM
#6
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Things get nasty at work..
Quote:
Originally Posted by Aaron Christy
I can't believe that Nik hasn't responded yet

We had a mini-meltdown in the morning, and right about Don's post time another serious issue came back..
I guess we all gonna have some fun with our apps tonight...

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 05:30 PM
#7
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
First tests: "old" API seemed to work as it did. Or did not.
Changed URL to go to api instead of upload.
Recompiled SE and ran all basic scenarios (sorry, didn't build separate QA facility yet:-)
Thus far SE only untilizes what I tend to call "old" API, most of them circa fall 2004 (with some bugfixes and friend/family/sorting related novelties circa January 2005).
As a result of these tests, the good news is:
what was working - still works
Seems like no damage was done as a side effect of the new changes.

As a partially bad news: what was not working - still does not.
Again, I'm only talking about the old API, from which the only non-working method was anonymous login.
"Partially": as far as I mostly interested in upload and other "priviledged" actions, anonymous login was of purely academic interest to me (translation: don't really care:-).

Here's the list of verified APIs:
Working:
  • loginWithPassword
  • loginWithHash
  • logout (works even with anonymous login)
  • getCategories
  • getSubCategories
  • getAllSubCategories
  • getAlbums
  • multipart upload (aka upload via POST)
Not working (* see below):
  • loginAnonymously
    I can login and logout, but none of the above command works, response being
    invalid user (4)
[EDIT]
*) As we established in a discussion below, this is a behavior by design. As far as anonymous session does not know about any particular account, most of the account specific methods will return empty/invalid resutls.
So it works, but the limits of its work are really narrow..
I guess that concludes it for me - I'm gonna drop anonymous support from SE
[/EDIT]

Didn't test:
  • getAlbumInfo
  • createAlbum
  • changeAlbumSettings
  • reSortAlbum
  • getImages
  • getImageURLs
  • getImageInfo
  • getImageEXIF
  • changeImageSettings
  • changeImagePosition
  • upload (since there is no real need to use it, I dropped supporting code)
-------

Hope you guys will bring more test cases!

HTH

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time

Last edited by Nikolai; Mar-05-2005 at 07:50 AM.
Old Mar-04-2005, 05:56 PM
#8
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Thank you, looks much better now..
Quote:
Originally Posted by Nikolai
In the apps section:
  • is it possible to change the formatting in a way it does NOT depict everybody else as a plugin to SendtoSmugmug?
  • I personally would appreciate if you set the order to alphabetical or chronological (FIFO)..
As to the order - I guess one can never reach all his goals, something has to be left to desire

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 07:51 PM
#9
Aaron Christy is offline Aaron Christy
Last in line for pie
Quote:
Originally Posted by Nikolai
  • loginAnonymously

    I can login and logout, but none of the above command works, response being

    invalid user (4)




Nik,


I didn't get home until late so I really haven't had a chance to do a very thorough test, but the one method I was most interested in was loginAnonymously.


I was able to get it working correctly and call getImages/getAlbums/etc. without any problems.


The session ID returned from the loginAnonymously seemed valid and without issue.


-Aaron-
Old Mar-04-2005, 09:13 PM
#10
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Interesting...
Quote:
Originally Posted by Aaron Christy
Nik,
I didn't get home until late so I really haven't had a chance to do a very thorough test, but the one method I was most interested in was loginAnonymously.
I was able to get it working correctly and call getImages/getAlbums/etc. without any problems.
The session ID returned from the loginAnonymously seemed valid and without issue.
-Aaron-
Aaron,
I guess it's a good news.
Thank you for pitching in:-)
Let me double check a few things, now that I know that it may work:-)
I'll post the results asap.
Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 09:27 PM
#11
onethumb is offline onethumb OP
SmugMug CEO & Chief Geek
onethumb's Avatar
Quote:
Originally Posted by Aaron Christy
Nik,


I didn't get home until late so I really haven't had a chance to do a very thorough test, but the one method I was most interested in was loginAnonymously.


I was able to get it working correctly and call getImages/getAlbums/etc. without any problems.


The session ID returned from the loginAnonymously seemed valid and without issue.


-Aaron-
I'm also using it fine. What are you seeing, Nik, that isn't working?

Don
Old Mar-04-2005, 10:24 PM
#12
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Still cannot get it :-(
Aaron, Don

I tried again and again - still cannot get it work..
Can you guys do me a favor and look at this dump - may be you spot something stupid?

PHP Code:
0:05:45:   Started Logging in anonymously
0:05:45:     Post to https://api.smugmug.com/xmlrpc/
<?xml version="1.0"?>
<methodCall>
<methodName>loginAnonymously</methodName>
<params>
<param><value>1.0</value></param>
</params>
</methodCall>
0:05:45:     Post results
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<params>
<param>
  <value>
   <struct>
    <member>
     <name>SessionID</name>
     <value>
      <string>a7c35117f0fb367f1e7b20c865669f99</string>
     </value>
    </member>
   </struct>
  </value>
</param>
</params>
</methodResponse>
0:05:45:   Finished Logging in anonymously (0:00:01)
0:05:45:   Logged in: Session: a7c35117f0fb367f1e7b20c865669f99; User: ; Hash: 
0:05:48:   Started Gettings list of albums
0:05:51:       Post to http://api.smugmug.com/xmlrpc/
<?xml version="1.0"?>
<methodCall>
<methodName>getAlbums</methodName>
<params>
<param><value>a7c35117f0fb367f1e7b20c865669f99</value></param>
</params>
</methodCall>
0:05:51:       Post results
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<fault>
<value>
  <struct>
   <member>
    <name>faultCode</name>
    <value>
     <int>4</int>
    </value>
   </member>
   <member>
    <name>faultString</name>
    <value>
     <string>invalid user</string>
    </value>
   </member>
  </struct>
</value>
</fault>
</methodResponse>
0:05:51:       RPC-XML: invalid user (4)
0:05:51:     Finished Getting albums for PhotoSoCal (0:00:00)
</FONT>
</FONT>
Any idea what am I doing wrong? Same code works fine with non-anonymous login.

TIA

Cheers
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-04-2005, 10:35 PM
#13
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
A small comment (grasping the straws)
I thought maybe the problem was that I was logging in using https and was doing other requiests via plain http.
Did more tests, used various combinations - both secured, both non-secured, ect - same stuff..
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-05-2005, 12:28 AM
#14
onethumb is offline onethumb OP
SmugMug CEO & Chief Geek
onethumb's Avatar
Quote:
Originally Posted by Nikolai
Aaron, Don

I tried again and again - still cannot get it work..
Can you guys do me a favor and look at this dump - may be you spot something stupid?

PHP Code:
0:05:45:   Started Logging in anonymously
0:05:45:     Post to https://api.smugmug.com/xmlrpc/
<?xml version="1.0"?>
<methodCall>
<methodName>loginAnonymously</methodName>
<params>
<param><value>1.0</value></param>
</params>
</methodCall>
0:05:45:     Post results
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<params>
<param>
  <value>
   <struct>
    <member>
     <name>SessionID</name>
     <value>
      <string>a7c35117f0fb367f1e7b20c865669f99</string>
     </value>
    </member>
   </struct>
  </value>
</param>
</params>
</methodResponse>
0:05:45:   Finished Logging in anonymously (0:00:01)
0:05:45:   Logged in: Session: a7c35117f0fb367f1e7b20c865669f99; User: ; Hash: 
0:05:48:   Started Gettings list of albums
0:05:51:       Post to http://api.smugmug.com/xmlrpc/
<?xml version="1.0"?>
<methodCall>
<methodName>getAlbums</methodName>
<params>
<param><value>a7c35117f0fb367f1e7b20c865669f99</value></param>
</params>
</methodCall>
0:05:51:       Post results
<?xml version="1.0" encoding="iso-8859-1"?>
<methodResponse>
<fault>
<value>
  <struct>
   <member>
    <name>faultCode</name>
    <value>
     <int>4</int>
    </value>
   </member>
   <member>
    <name>faultString</name>
    <value>
     <string>invalid user</string>
    </value>
   </member>
  </struct>
</value>
</fault>
</methodResponse>
0:05:51:       RPC-XML: invalid user (4)
0:05:51:     Finished Getting albums for PhotoSoCal (0:00:00)
</FONT>
</FONT>
Any idea what am I doing wrong? Same code works fine with non-anonymous login.

TIA

Cheers

The problem is that you're not giving getAlbums any sort of indication which user you'd like albums for. :)

Remember, you're logged in anonymously, so there's no user associated with your session. getAlbums() can only do one of two things: send you all albums on smugmug, or send you none. Since I don't want to send you all, I have to send you none.

Hope that helps!

Don
Old Mar-05-2005, 04:38 AM
#15
rutt is offline rutt
Cave canem!
rutt's Avatar
Very nice, but still no support of statistics. Why not? If not now, when?

Thanks.
Old Mar-05-2005, 04:42 AM
#16
devbobo is offline devbobo
technicolored
devbobo's Avatar
changeAlbumSettings & getImageEXIF ?
Anyone else still having problems with changeAlbumSettings or getImageEXIF ?

For me, changeAlbumSettings is returning a response XML with unpopulated elements.

And getImageEXIF is returning the error "Invalid User".

Cheers,

David
__________________
David Parry
SmugMug API Developer
My Photos
Old Mar-05-2005, 05:26 AM
#17
flyingpylon is offline flyingpylon
Major grins
Quote:
Originally Posted by onethumb
- updated and added URLs to the known apps/scripts/etc. Holler if yours is missing or wrong.
Could I get a link to Smugmug Exporter at http://www.flyingpylon.com/se/ ?

Thanks for the updates to the API.
__________________

Old Mar-05-2005, 07:44 AM
#18
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
You beat me to it...
Quote:
Originally Posted by onethumb
The problem is that you're not giving getAlbums any sort of indication which user you'd like albums for. :)

Remember, you're logged in anonymously, so there's no user associated with your session. getAlbums() can only do one of two things: send you all albums on smugmug, or send you none. Since I don't want to send you all, I have to send you none.

Hope that helps!

Don
Last night I went to bed, still thinking about what am I doing wrong - and just before I disconnected from reality I got this revelation: as far as I do not provide any account information for login, session id does not carry it - hence there is no way in hell this call possibly could work - which you just confirmed:-)

Now that we established that I am stupid and that anonymous session does dont carry any account info, I have a question - what methods can possibly work with anonymous login?
Thanks!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Old Mar-08-2005, 05:59 AM
#19
Aaron Christy is offline Aaron Christy
Last in line for pie
I noticed an issue (I think) with LoginAnonymously method.

(Side note: I can't figure out how to post XML without it getting stripped!)

In Nik's example his method call has a methodCall/params/param/value node where the 1.0 string goes.

Based on XML-RPC standards, shouldn't it be: methodCall/params/param/value/string ?

In which case, this method call will fail.

Don/Nik, thoughts?
Old Mar-08-2005, 06:48 AM
#20
Nikolai is offline Nikolai
Darth SLR
Nikolai's Avatar
Standard also says
Quote:
Originally Posted by Aaron Christy
In Nik's example his method call has a methodCall/params/param/value node where the 1.0 string goes.
Based on XML-RPC standards, shouldn't it be: methodCall/params/param/value/string ?
That "string" part is "by dafault" and can be omitted at sender's discretion.
Judging by the fact that I'm using the same "request generator" for all my RPC-XML calls and they all work (including getting session id from anonymous login), I think it's ok to skip it..

HTH

Cheers!
__________________
"May the f/stop be with you!"
Star*Explorer: on Dgrin, home; Master Class: open;
Class is in session, My Facebook, @DarthSLR, #NiksTips
member: NAPP, PPA, partner: Adobe
Comprehending life, universe and everything - one pixel at a time
Page 1  of  3
1 2 3
Tell The World!  

Thread Tools
Display Modes

Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump