How does one find the Album ID and Album Key given its URL using API 1.2.2?
ckelley
Registered Users Posts: 26 Big grins
I'm writing server-side code in C# to upload images from an ASP.NET website to SmugMug via API 1.3.0. I figured out that a 1.3.0 Album has become a Gallery. The following code will find a Gallery given its URL:
I need help on how to navigate the folder structure that determines the URL using API 1.3.0 because I need to create a nested folder structure if I don't find the the gallery by its URL. I need to:
Can API 1.3.0 traverse nested folders in the new SmugMug?
If not, what API verion and method should I use? I can't wait for API 2.0.
// post image to SmugMug IWebClient wc = new WebClient(); IProtocol protocol = new RestProtocol(); SmugmugClient smugMugClient = new SmugmugClient(wc, protocol); LoginWithHash login = new LoginWithHash(Config.ApiKey, Config.UserId.Value, Config.PasswordHash); SmugmugSession session = new SmugmugSession(smugMugClient, login); if (session != null) { List<Album> albums = session.GetAlbums().ToList(); Album album = albums.Where(a => a.Url == "http://idtech.smugmug.com/UCBERK/IDTC/2014/June23June272014").FirstOrDefault(); if (album != null) { session.UploadImage(path, (int)album.Id, album.Key, "CAK Test", null, null); } }
I need help on how to navigate the folder structure that determines the URL using API 1.3.0 because I need to create a nested folder structure if I don't find the the gallery by its URL. I need to:
- search for a top-level folder,
- retrieve one of its subfolders,
- create a sub-folder and
- create a gallery
Can API 1.3.0 traverse nested folders in the new SmugMug?
If not, what API verion and method should I use? I can't wait for API 2.0.
0
Comments
I had to fix SmugMug.Net wrapper as it did not support SubCategories correctly. The following code is working: