Having trouble creating creating albums in a subcategory
derfberg
Registered Users Posts: 8 Beginner grinner
Hi,
I'm new to working with the API but I have been able to figure out how to create new albums using Mugatron's apple script (many thanks!) and re-purposing it. My problem is that when I create a new album it will be created in the correct category but the AlbumTemplateID and SubCategoryID's do not get set. Here's what I'm passing in via the API:
tell application "http://api.smugmug.com/hack/xmlrpc/1.1.1/"
call xmlrpc {method name:"smugmug.albums.create", parameters:{{|SessionID|:"211e6a0236d1c33dedec3832fdcee498", |Title|:"TEST", |CategoryID|:158817, |AlbumTemplateID|:30286, |SubCategoryID|:328649}}}
end tell
The "TEST" album gets created and assigned to the correct categoryID but not the subcategory and the template does not get applied either. Both are using valid id's that exist. What am I doing wrong?
Thanks,
Derf :dunno
I'm new to working with the API but I have been able to figure out how to create new albums using Mugatron's apple script (many thanks!) and re-purposing it. My problem is that when I create a new album it will be created in the correct category but the AlbumTemplateID and SubCategoryID's do not get set. Here's what I'm passing in via the API:
tell application "http://api.smugmug.com/hack/xmlrpc/1.1.1/"
call xmlrpc {method name:"smugmug.albums.create", parameters:{{|SessionID|:"211e6a0236d1c33dedec3832fdcee498", |Title|:"TEST", |CategoryID|:158817, |AlbumTemplateID|:30286, |SubCategoryID|:328649}}}
end tell
The "TEST" album gets created and assigned to the correct categoryID but not the subcategory and the template does not get applied either. Both are using valid id's that exist. What am I doing wrong?
Thanks,
Derf :dunno
0
Comments
I will check it out tomorrow for you.
Cheers,
David
SmugMug API Developer
My Photos
Derf
I tried playing with this some more and thought that maybe using the changeSettings method would work to set the sub-category once I had created the new album in a category but I got a system error when I tried to use it. I tried to change a few other settings as well but I got the same error message. I'm guessing I'm doing something wrong but I can't tell what it is and I have tried many many different ways to try to get it to work to no avail. Any help would be much appreciated.
Thanks,
Derf
I have been knee deep in rewriting some feed stuff the past day or so.
I promise I will look tomorrow.
Cheers,
David
SmugMug API Developer
My Photos
David - you seem to be the only one that can help me - how's your schedule looking? Alternatively - is there a better protocol to use with apple script than xml-rpc? I can't find anything other than xml-rpc or SOAP for apple script - the API doesn't work with SOAP right? Do you know how to use REST with apple script or can you point me in the right direction?
Thanks,
Derf
Sorry about the delay, it does work, but it needs to be configured like this...
tell application "http://api.smugmug.com/hack/xmlrpc/1.1.1/"
call xmlrpc {method name:"smugmug.albums.create", parameters:{{|SessionID|:"211e6a0236d1c33dedec3832fdcee498", |Title|:"TEST", |CategoryID|:158817, parameters:{|AlbumTemplateID|:30286, |SubCategoryID|:328649}}}}
end tell
So all parameters (other than SessionID, Title and CategoryID) need to be passed inside the parameters array.
Cheers,
David
SmugMug API Developer
My Photos
That was it - I knew it had to be something I was missing being new to applescript and the api. Thank you so much for straightening me out David!
My work continues...
Derf