Quantcast
Channel: Digital Grin Photography Forum - SmugMug APIs, Hacks & Tricks
Viewing all 147 articles
Browse latest View live

Objective C (xcode) wrapper for 1.2.2 and 1.3.0

$
0
0
Brand new... Also new at using Smugmug API. I've been trying to use Chris Beauvois's CocoaSmugMug, but it is so old now, i'm having to totally hack it up.

Are there any current wrappers available? Any help is appreciated, i've got an iOS app I'm working on.

Thanks for any help.

Need a Simple Example for OAuth in Xcode

$
0
0
I was able to write my own wrapper of-sorts for the API 1.2.2, but I'm getting hung up on some of the details around doing OAuth. The links are just too generic and don't use the same language as the API 1.2.2 documentation.

Does anyone have a simple and complete example. With some descriptions of Key/APIKey Token/Secret and how to get a good Nonce?

Thanks to anyone that can help.

OAuth Broken?

$
0
0
Is the OAuth service broken tonight?

Everything has been working pretty well in my published app, but tonight I'm seeing the following come back on POST calls to https://api.smugmug.com/services/oau...equestToken.mg

Code:

oauth_problem=signature_method_rejected
My POST is below (but is properly encoded when sent):
Code:


 POST https://api.smugmug.com/services/oauth/getRequestToken.mg HTTP/1.1
 Accept: */*
 Authorization: OAuth oauth_callback='my_callback, oauth_consumer_key='my_key', oauth_nonce='348560084', oauth_signature='2M40WS%2BQQxh8jDEptO%2FgOHZOzUY%3D', oauth_signature_method='HMAC-SHA1', oauth_timestamp='1394859583', oauth_version='1.0'
 Accept-Language: en-US,en;q=0.5
 UA-CPU: AMD64
 Accept-Encoding: gzip, deflate
 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; Touch; MSAppHost/2.0; rv:11.0) like Gecko
 Host: api.smugmug.com
 Content-Length: 0
 Connection: Keep-Alive
 Cache-Control: no-cache

Is HMAC-SHA1 no longer accepted? The OAuth docs for SmugMug here say it should be fine: https://smugmug.atlassian.net/wiki/display/API/OAuth

wpSmugmug for Windows Phone

API - Get your SmugMug picture on your website

$
0
0
Hello everyone!

I am new here and looking for help regarding SmugMug API.

I have created some albums on smugmug and uploaded pictures on it. now, i want to show the same on my website using API. So whenever someone open my website and the API will call the albums and pictures uploaded on SmugMug.

I using Vimeo API as well for videos. you can see here ~ http://www.aklodi.com all of the videos are coming from my vimeo account even the thumbnails of video are coming from vimeo server.

Thanks in Advance!

Hamid.

Best way to deal with thousands of duplicates??

$
0
0
Due to upload script issues, I've uploaded a few thousand duplicates over the last week. (Sorry for the bandwidth smugmug!) They've been scattered to various Galleries that also have non-duplicated photos.

What's the best way to clean this up? The tool smugline (https://github.com/gingerlime/smugline) says it can 'clear_duplicates', but smugline's documentation calls itself "young and experimental". Any other tools? Webpage techniques?

Is there anyway to delete all uploads from the last N days?? (via tool or webpage)

Other ideas?

Once I fix this...
Any recommended linux command line tools for
  • uploading while checking for dupes (smugline says it will do this too), or
  • keeping galleries and local directories in sync?
Thanks,
tntc

JavaScript JSON Example

$
0
0
Is there any code out there that will show me how to AJAX get a gallery feed via JSON? I have two clients who want to display their gallery on their site but the iframe method just doesn't work too well. It gets clipped and they want to customize the look and feel of it on their site.

I can get an XML feed of the data, but want to get it via JSON, or at least be able to pull it in via JQuery if it has to be XML. My code below doesn't work. I get this error:

Object {responseData: null, responseDetails: "Feed could not be loaded.", responseStatus: 400}


Here's my code:

<script type="text/javascript">
$(function () {
var FEED_URL = "http://api.smugmug.com/hack/feed.mg?Type=nicknameRecentPhotos&Data=omphotograp hy&format=atom10&Sandboxed=1";

$.ajax({
url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=10&callback=?&q=' + encodeURIComponent(FEED_URL),
dataType: 'json',
sandboxed: 1,
success: function (data) {
console.log(data);
}
});
});
</script>


*And please don't tell me to double encode it. I already tried that.

How to get User's Profile Picture URL

$
0
0
HI,

I want to get the user's profile picture url. Is there any api method by which I can get the profile picture url ? or can I form that url by any means ?

I tried using smugmug.users.getInfo but it return only name, nick name and page url.

Can anyone help me to get this.

Thanks in advance

System Error [code 15] while creating an album

$
0
0
Hi All,

I am trying to create an album using smugmug.albums.create method. My URL looks something like below:

http://api.smugmug.com/services/api/...=mydescription

However on sending a request on the above URL using OAUTH protocol I am getting below JSON response from SmugMug

{"stat":"fail","method":"smugmug.albums.create","c ode":5,"message":"system error"}

I have no idea what should be the scope of correction at my end after seeing this error. However I can see a folder named "Other" is getting creating at my end. I am using New SmugMug.

Can anyone have any clue what I am doing wrong.

Thanks in advance

Where can I get an open source C# sample project for SmugMug API 1.3 or 2.0?

$
0
0
Hello,

I'm an ASP.NET web developer who is new to SmugMug. My task is to upload photos and videos of arbitrary size in batches of up to 300 files to SmugMug from an ASP.NET webform page. Here's what I have already completed:
  • I have an ASP.NET webform project that enables a user to select multiple files from their local disk and upload them to my server in a single operation.
  • Large files are automatically chucked while uploading to work around HTTP request size limitations.
  • Progress bars appear next to thumbnails to provide feedback during an upload operation.
  • File uploads in progress can be individually cancelled.
  • The application automatically creates thumbnails of the uploaded images on the server and displays them to the user when an upload operation completes.
  • Uploaded files can be selectively deleted.
  • I have my SmugMug API key.
Now I need to invoke the SmugMug API 1.3 or 2.0 from C# 4.5 to save/delete files to SmugMug.

Here's what I've found searching the web so far for ASP.NET source code:
Neither of the above contains the class library that I am looking for. Can anyone point me to something more current than the above?

Migrate old ID when uploading to Smugmug

$
0
0
I'm looking for a way to store the original photo id number when transferring photos to Smugmug.

I had been looking for a way to preserve my collection of photos on an old copy of Gallery (Menalto open source). Upgrading Gallery wasn't working or even fun anymore and I decided on Smugmug for longterm storage. I tried a couple of the tools on the third party page: Smuglr, Migratr and Gallery Album to SmugMug) but they didn't work either because of version differences, wouldn't transfter captions or they simply didn't work.

So I wrote my own program on top of Colin Seymour's PHP wrapper (phpSmug). After cleaning up my old gallery (no albums within albums, etc.) I transferred all the albums over with directory structure, titles and captions (not as easy as all that, but I got it).

I'm using images_uploadFromURL with an array containing the parameters. I easily add the Gallery Id number to pass to Smugmug. I've tried ['Extras'], ['Serial'], etc. as spec'd in the API docs and I've tried just adding another value ['GalleryId'].

But the information does not come back when I do an images_get or images_getInfo APIs.

I'm using PHP API 1.3.0. Would V2 have anything for me?

Any ideas would be appreciated.

Thanks

Problem uploading images

$
0
0
Hello! Anytime I try to upload an image using my app, I receive this message:
{"message":"Uploading Interrupted. Please retry.","method":"smugmug.images.upload","stat":"f ail","code":61}

Do you know what's going on?

Thanks in advance.

Smugroom Gone?

$
0
0
I use Smugroom's gallery ID tool all the time in order to make permanent links when posting my photo albums to blogs, FB, etc. Today, I can't access the site. Does anyone know if this is a temporary or permanent outage?

And is there another way to get the gallery ID short of choosing an image, going into "Get a Link" and copying the ID from the "Buy" option?

How does one find the Album ID and Album Key given its URL using API 1.2.2?

$
0
0
I'm writing server-side code in C# to upload images from an ASP.NET website to SmugMug via API 1.2.2. Given the URL to a gallery, I need to find its Album ID and Album Key. I figured out that a 1.2.2 Album has become a Gallery. The following code will work if all Galleries have unique titles:

Code:


                // post image to SmugMug
                IWebClient wc = new WebClient();
                IProtocol protocol = new RestProtocol();
                SmugmugClient smugMugClient = new SmugmugClient(wc, protocol);
                LoginWithHash auth = new LoginWithHash(Config.ApiKey, Config.UserId.Value, Config.PasswordHash);
                Login login = auth.Login(smugMugClient);
                if (login != null)
                {
                    AlbumCollection albums = smugMugClient.GetAlbums(login.Session.Id, null, null, null, null, null, null, null, null);
                    Album album = albums.Where(a => a.Title == "June-23-June-27-2014").FirstOrDefault();
                    if (album != null)
                    {
                        smugMugClient.UploadImage(login.Session.Id, path, album.Id, album.Key, null, null, null);
                    }
                }

I could use some advice on how to find a Gallery given the title of its ancestry folders.

private photos copied to unlisted/public folders.

$
0
0
Hey all - new to this site and looks like quite a bit of useful information. I just recently signed up to smugmug and hopefully can contribute some tricks and lessons learned going forward.

My goal for smugmug would be to backup my local photos onto smugmug. With the unlimited data, its a great candidate for this. Having access to pictures anywhere i have an internet connection is a bonus. My second goal would be to be able to make additional gallery's that i can organize for family and friends. Above all, my goals is privacy. Not that i'm ashamed of my 'little kitten' photos, i just prefer to keep photos as private as possible. (and yes, i do understand smugmug has visibility to all photos).

So - initially, i createf a private folder at the root. I created sub folders below the private root folder which inherits the privacy from its parent (nice). i then created a private gallery below the private folders.

My second step was to create a unlisted/public folder & gallary at the root in parallel to my private folder. My thinking was that these "unlisted" or "Public" folders i would be able to drag some of my private pictures into it. Hence, i could control which pictures where visible and which pictures were not. Immediately i found out that a "unlisted" or "public" gallery can't access a "private" folder/gallery.

I was told by smugmug that this is intentional. No private/unlisted folder could reference a private folder. I was informed my options where to make a copy of the photo into the unlisted/public folder. I tried that and it did work - but the procedure and interface to do this was ridiculous and furthermore you couldn't tell which photo is the copy and which was the private. I wouldn't' even credit this solution a hack.

So, i'm trying to find out from you out there. How would one organize their folders to achieve private photos with unlisted/public photos

As far as i can tell i have the following options:

1) Smugmug Copy each photo i want to place into put into the unlisted/public folder as mentioned above.
2) Change my private folder to be unlisted w/ password.
3) Upload another copy of photo to unlisted/public folder.
4) Use some 3rd party application that would copy the photo in a much more elegant manner. I'm on Mac OSx.


Really, unless i'm missing an option, i can only see option #4 being feasible, yet i haven't found any 3rd party apps that do this.

If i did change my private folder to unlisted/ password, does that equal to the same privacy as a folder being private?

thank you
~george

smugmug.images.get returning only list of IDs

$
0
0
I'm trying to fetch the contents of an album. I'm using the smugmug.images.get method, specifying "&Heavy=true" to get the full ("heavy") details of its contents.

What is returned is a simple list of IDs. This isn't the standard result, which according to the documentation returns some info about the album and then a list of image IDs and keys. It certainly isn't the "heavy" result. All I get is a list of image IDs, no keys, no album info.

Here's the result (I truncated the IDs to 4 digits, otherwise it's unaltered):

Code:

<?xml version="1.0" encoding="utf-8" ?><rsp stat="ok">
                                <method>smugmug.images.get</method>
<Image id="1231" /><Image id="1232" /><Image id="2700" /><Image id="2726" /><Image id="8487" /><Image id="8913" /><Image id="7187" /><Image id="7804" /><Image id="1389" /><Image id="1324" /><Image id="1348" /><Image id="1675" /><Image id="0474" /></rsp>

smugmug.images.changeSettings: quoting caption/keywords

$
0
0
What's the right way to pass the Caption and Keywords strings in smugmug.images.changeSettings? I'm using 1.2.2, and it seems to be OK with a single-quote for Keywords, but doing that or double-quotes with Caption truncates it.

Example:

Code:

GET /hack/rest/1.2.2/?method=smugmug.images.changeSettings ... &Caption='This is a caption' ...
Result:
Code:

<?xml version="1.0" encoding="utf-8" ?><rsp stat="ok">
          <method>smugmug.images.changeSettings</method>
          <result>1</result></rsp>

But looking at the image in Smugmug, or fetching the info, shows the caption as 'This (with an opening quote and the first word, but nothing else)

I notice that when uploading, each attribute is in its own header. For example, when calling upload.smugmug.com, the caption is passed as
X-Smug-Caption: 'This is a caption' which works fine.

Uploading multi-line Caption via upload.smugmug.com

$
0
0
When uploading using upload.smugmug.com, the caption can be set by including an X-Smug-Caption: header field. This is fine for simple captions, but fails when the caption contains embedded newlines (and perhaps other characters). Is there a way to encode arbitrary characters during HTTP transport that SmugMug accepts?

Pagination with API returns?

$
0
0
Hello,

Anyone have any experience implementing pagination with SmugMug API returns (albums or images) using PHP? I know it's practical to implement pagination for simple mySQL DB queries using PHP but I'm really not sure if its possible to paginate the response to a SmugMug API call.

Thanks!

Setting "Featured" image for an album

$
0
0
Is there any way using API 1.2.2 or API 1.3.0 to set the Featured image for an album? I don't see an obvious way to do this, although once it's set it does show up in the "Highlight" array in the "album" structure that's returned by smugmug.albums.getInfo and smugmug.albums.get.

Thanks.
Viewing all 147 articles
Browse latest View live