Minor API changes
onethumb
Administrators Posts: 1,269 Major grins
You'll see updated docs tomorrow, but I thought I'd let the hardcore know in advance:
- smugmug.images.getInfo now also includes the proper URLs, saving you a call if you were doing both that and getURLs
- smugmug.albums.changeSettings should work again.
- smugmug.images.upload 's bug was fixed.
I think that's probably it. The new album setting ('DefaultColor') also works, and will be reflected in the new docs.
Don
- smugmug.images.getInfo now also includes the proper URLs, saving you a call if you were doing both that and getURLs
- smugmug.albums.changeSettings should work again.
- smugmug.images.upload 's bug was fixed.
I think that's probably it. The new album setting ('DefaultColor') also works, and will be reflected in the new docs.
Don
0
Comments
Don,
Thank you for the fixes, hopefully we'll be able to get your feedback on them soon!
And I *realy* appreciate this "what's new"!
Please keep doing that!
Now with APi becoming more extensive and complex going through all the help pages and compare line to line is no fun at all..
Cheers!
REST or XML-RPC? REST looks like it's working for me, and since they share a common codebase, I assume XML-RPC is working too. I can double-check later, though.
Don
Alright, well, I'm at a loss since I'm able to change my settings just fine.
Can you please post your XML-RPC request so I can take a look? I must be missing some corner-case.
Don
The only slightly unusual thing is that I use CDATA for the session ID string - my XML-RPC tool uses CDATA for all string values. But the same is true for all my other requests, and they all work fine.
Spent some time playing with your XML, and it seems to work for me.
Then I got the brilliant idea of actually checking your album in question, and discovered that it already has those three settings.
Setting an albums' settings to the exact same settings will fail with a system error 5.
Can you try setting a property which is different, instead?
Can anyone else verify that changing album settings is still broken? Every test I've tried for a few weeks has worked, so I'm still lost.
Don
I'll give it a try. I'm not sure if I'll be the first one to report since I'm leaving for my El Camino Real - Yosemite trip soon. Hopefully other guys will be faster..
Oh, I doubt this is your problem, but I should note that for some reason, your a.txt file has "xml.version" instead of "xml version" which caused the parser to choke.
Once I changed that period, though, I haven't gotten any system errors with that XML or similar XML.
Don
Oh, sorry, that was because I re-created the XML input from a tcpdump trace file, and in that file all the non-printable characters are shown as periods. This includes space. So I guess I missed converting that one back to a space.
Anyway, your explanation that changing settings to what they already are causes the error makes sense, I'm sure that's what was happening.
What do you think about not generating an error for that case?
Don, I had a couple hours to burn last night so I decided to look at that method again. And now that I was paying an attention to details I have noticed two things which kinda stopped me from going any further:
- There is no CategoryID in the struct.
- Judging from the presence of Default values I'm guessing that if I skip an option it will be set to default, not "left as is". That immediately means that if I'm to try to change settings of several albums at a time (in which action many SM users expressed a keen interest) I would have to read each album' settings first, update the "changed" settings, and post the whole set back (otherwise the "unset" options would be reset to default values).
Please confirm or correct.This means that while you can use this method to move the album to a different SubCategory, you cannot change the Category, so API-wise albums are stuck within the original categories. I was hoping for this method to do the job, but it does not look so.
Am I wrong, and CategoryID simply didn't make it to the manual?
Which increases the total time approximately twice.:-(
Am I correct?
I'll have to give it some thought, but it's really not that easy to "not generate" an error since multiple writers could be writing to the same album at nearly the same time and I could just be missing something temporally. I suppose "close enough" could be good enough, but I'll have to think about it.
Don
Any setting you get back, except for AlbumID, can be set, including CategoryID. If the docs don't have that, it's a doc problem, not a problem with the method. You tried this and it failed?
You're wrong. Any setting you don't set will be left as-is, meaning the Default for newly created albums, and whatever is currently set on a changeSettings call.
Were you able to use the method, then? Can I stop tearing my hair out because everything I do works?
As a general note, you should never be afraid to try something in the API to see if it works. If something breaks, we've found a bug. If something works, we can clarify the docs. But not trying it just tends to waste time.
Don
I will give it another try..
And how was I supposed to know this without the docs, may I ask you?
Again, who wrote the docs? Album settings APIs are hands down the most complicated API you've published so far, and giving the considerable history of it's being in non-working state I hope you'd understand my being cautios..
Don, please.. I did waste more than a fair value of *my* time burning fingers on the new APIs since January.. This one requires a lot of associated UI work, hence I simply want to be sure it's worth it. I trust you got it working for you, and I'm extremely glad to hear this, but with the incomplete docs and the whole "highly experimental nature" aspect, what do you expect me to do, dive in head first?
*You've* asked for assistance in testing/confirming, I'm trying to help, so please level with me..
Boy, am I glad to hear this:-)!
Not yet. Now that you have confirmed it should work as I hoped it would I will proceed..
As a general note, I have a deep respect for you and your work.
And being around various computers for 28 years I'm not afraid to try virtually anything.
But speaking of time-wasting I've wasted too much of mine (because it was said something works while it didn't) to advance without at least getting some solid recon.
Things are getting much better now in the API department, but it's still a lot of efforts on our side.
Up-to-date docs would also help to avoid the confusions, misunderstandings and frustration.
I will let you know my results.
Cheers!
From the docs: "All settings are optional, if omitted, the current value for that setting is preserved." Been there since this method was exposed.
Don
It doesn't take a couple of hours to submit a CategoryID change and see what happens.
Don
Let me ask you - is CategoryID mentioned there, too? Or was I again asking a silly question?
So how shall I know which part of the doc to trust and which not?
I spent 15 minutes. I decided it's too much of uncertainty and decided to ask first. I spent other 1:45:00 downloading, installing and playing with CS2.
And I'd like to remind you of this (*still* being the operative word): Just trying to help.. I'm known to be a slow starter. As I said in the very first reply to this post of yours, I hope you'll get quicker answer from somebody else..
If it does not fit the help profile you need - sorry...
Cheers!
Sounds like you're overthinking it.
Here's a little thought experiment. The API doc for smugmug.albums.changeSettings says, regarding the struct of things to change, "optional, any or none of these can be present". If the struct is empty or not there, what happens? Does it generate a system error 5 every time? According to your earlier post, it should, since the call is changing the album's settings to what they already were. And yet the doc says such a call is ok.