Do I need an API key?

Nov 4, 2009 at 7:15 PM

Hello,

 

This is really great and you've done a wonderful job!  :)  I do have one question, do I need to get an API key from Smugmug in order to create my own application, or can I just use what you have made available?

 

Thanks!

Brian

Nov 4, 2009 at 7:22 PM

Sorry ... I got click happy.  I did see an API Key in the CommunicationsHelper class but I assume that's yours, correct?

Coordinator
Nov 4, 2009 at 9:54 PM
Edited Nov 4, 2009 at 9:57 PM

Hi.

I’m glad you find my app useful. Every developer building an app for SmugMug needs an API key which is unique to him/her. If you are using one of my apps or dlls , you don’t need an API key,. If you are building your own, you do need an API key for it.

Maria

Dec 14, 2009 at 8:42 AM
Edited Dec 14, 2009 at 8:42 AM

Hey,

 

Thanks buddy! Its really helpful.

 

 

Regards

Munish Singla

Dec 14, 2009 at 10:40 AM

Hi Alex,

This code is working ok for creating new album & upload images in same. I am trying to upload images in existing album by below code. All albums are retreived but, it gave error in last that "invalid album id". Please help.

            List<Album> objalbum = objUser.GetAlbums(true);
            Album oblAlb = new Album();
            oblAlb.id = objalbum[0].id;
            oblAlb.Key = objalbum[0].Key;
            var up = oblAlb.CreateUploader();
            up.UploadCompleted += new EventHandler<UploadEventArgs>(img_UploadCompleted);
            up.UploadProgress += new EventHandler<UploadEventArgs>(img_UploadProgress);
            String img1 = "C:\\launch.jpg";
            up.UploadImage(img1);


Looking forward to your response.


Thanks
Munish Singla

Dec 14, 2009 at 3:40 PM

Thanks, mariagh.  I finished the first version of my application using your SmugMug Model.  It saved me boat loads of time and I haven't had any problems ;).

Coordinator
Dec 14, 2009 at 6:26 PM
Edited Dec 14, 2009 at 6:28 PM

Hi Munish.

The problem is that you create a new album object.

 

You already have a list of albums that you get from the user.

List<Album> objalbum = user.GetAlbums();

 

If that list is not empty, it is enough to use any item from it as an upload album.

Album oblAlb = objalbum[i];

 

If the list is empty, you should create a new album. In order to do that, you don’t need a new Album object to send to SmugMug, just a title for the album, and the response that you receive is an object of type album. If you want to create the new album in a certain category, you have to specify that, otherwise, it will be in Other by default.

Album myAlbum = user.CreateAlbum("AlbumTitle"); -> category is Other

 var myAlbum = myCategory.CreateAlbum("AlbumTitle"); ->category is myCategory

 var myAlbum = mySubCategory.CreateAlbum("AlbumTitle");->subcategory is mySubcategory

 

Maria

Coordinator
Dec 14, 2009 at 6:31 PM

I'm glad it helps! That was the whole point :). Hope you found it easy to use, if you have any comments, suggestions, feel free to post them.

 

Thanks,

Maria

Dec 14, 2009 at 6:35 PM

Extremely easy to use.  I will post any suggestions to a new thread.

Coordinator
Dec 14, 2009 at 6:44 PM

Thank you,

Maria

Dec 15, 2009 at 2:54 AM

Hey Maria,

Thanks a lot. It really works!

 

Regards
Munish Singla

Coordinator
Dec 15, 2009 at 8:48 PM

Glad to help!

Maria