Options

Trouble hiding images in 1.2.0

truisttruist Registered Users Posts: 1 Beginner grinner
Hello,

I'm working on an app using the SmugMug API v1.2.0, via JSON, from Java. I have code that's working for nearly every operation I need to make, except hiding an image. I'm fairly sure my code is correct, as this call is structured the same way as all the rest of my code, but whenever I call the API, I get either a '500' error from the server (at the HTTP level) or when I retry the call, I get a response code of '5' ("system error") from the API. The funny part is, the call seems to succeed on the server - if I go look at the image in SmugMug, it has actually been marked 'hidden'.

I'm not sure how to debug this any further, so I was wondering if there is some bug on the server side, or if anyone else is experiencing this? (Note that I'm calling smugmug.images.changeSettings, and passing it an ImageID and Hidden (set to '1').

If you're willing to look at the code, the primary method is here and the object that handles the actual API call is here.

For debugging purposes, here's the apache commons-httpclient wire log for the two calls (with some items manually [retracted]):

MultiThreadedHttpConnectionManager - HttpConnectionManager.getConnection: config = HostConfiguration[host=https://api.smugmug.com], timeout = 0
MultiThreadedHttpConnectionManager - Getting free connection, hostConfig=HostConfiguration[host=https://api.smugmug.com]
header - >> "POST /hack/json/1.2.0/ HTTP/1.1[\r][\n]"
HttpMethodBase - Adding Host request header
HttpMethodBase - Default charset used: ISO-8859-1
HttpMethodBase - Default charset used: ISO-8859-1
header - >> "User-Agent: Smuganizer/0.90[\r][\n]"
header - >> "Host: api.smugmug.com[\r][\n]"
header - >> "Cookie: [retracted]
header - >> "Cookie: [retracted]
header - >> "Cookie: [retracted]
header - >> "Content-Length: 146[\r][\n]"
header - >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
header - >> "[\r][\n]"
content - >> "method=smugmug.images.changeSettings&APIKey=[retracted]&SessionID=[retracted]&ImageID=783338177&Hidden=1"
EntityEnclosingMethod - Request body sent
header - << "HTTP/1.1 500 Internal Server Error[\r][\n]"
header - << "HTTP/1.1 500 Internal Server Error[\r][\n]"
header - << "Server: Apache[\r][\n]"
header - << "X-Powered-By: smugmug/1.2.0[\r][\n]"
header - << "Cache-Control: private, max-age=1, must-revalidate[\r][\n]"
header - << "Content-Length: 0[\r][\n]"
header - << "Content-Type: application/json[\r][\n]"
header - << "Date: Tue, 09 Feb 2010 04:37:45 GMT[\r][\n]"
header - << "Connection: close[\r][\n]"
header - << "Set-Cookie: SMSESS=11568f3ac8b122e496048cefb92d362e; path=/; domain=.smugmug.com; HttpOnly[\r][\n]"
header - << "[\r][\n]"
CookieSpec - Unrecognized cookie attribute: name=HttpOnly, value=null
HttpMethodBase - Cookie accepted: "$Version=0; SMSESS=11568f3ac8b122e496048cefb92d362e; $Path=/; $Domain=.smugmug.com"
HttpMethodBase - Should close connection in response to directive: close
HttpConnection - Releasing connection back to connection manager.
MultiThreadedHttpConnectionManager - Freeing connection, hostConfig=HostConfiguration[host=https://api.smugmug.com]



MultiThreadedHttpConnectionManager - HttpConnectionManager.getConnection: config = HostConfiguration[host=https://api.smugmug.com], timeout = 0
MultiThreadedHttpConnectionManager - Getting free connection, hostConfig=HostConfiguration[host=https://api.smugmug.com]
HttpConnection - Open connection to api.smugmug.com:443
header - >> "POST /hack/json/1.2.0/ HTTP/1.1[\r][\n]"
HttpMethodBase - Adding Host request header
HttpMethodBase - Default charset used: ISO-8859-1
HttpMethodBase - Default charset used: ISO-8859-1
header - >> "User-Agent: Smuganizer/0.90[\r][\n]"
header - >> "Host: api.smugmug.com[\r][\n]"
header - >> "Cookie: [retracted]
header - >> "Cookie: [retracted]
header - >> "Cookie: [retracted]
header - >> "Content-Length: 146[\r][\n]"
header - >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"
header - >> "[\r][\n]"
content - >> "method=smugmug.images.changeSettings&APIKey=[retracted]&SessionID=[retracted]&ImageID=783338177&Hidden=1"
EntityEnclosingMethod - Request body sent
header - << "HTTP/1.1 200 OK[\r][\n]"
header - << "HTTP/1.1 200 OK[\r][\n]"
header - << "Server: Apache[\r][\n]"
header - << "X-Powered-By: smugmug/1.2.0[\r][\n]"
header - << "Cache-Control: private, max-age=1, must-revalidate[\r][\n]"
header - << "Content-Length: 49[\r][\n]"
header - << "Content-Type: application/json[\r][\n]"
header - << "Date: Tue, 09 Feb 2010 04:37:47 GMT[\r][\n]"
header - << "Connection: keep-alive[\r][\n]"
header - << "Set-Cookie: SMSESS=11568f3ac8b122e496048cefb92d362e; path=/; domain=.smugmug.com; HttpOnly[\r][\n]"
header - << "[\r][\n]"
CookieSpec - Unrecognized cookie attribute: name=HttpOnly, value=null
HttpMethodBase - Cookie accepted: "$Version=0; SMSESS=11568f3ac8b122e496048cefb92d362e; $Path=/; $Domain=.smugmug.com"
HttpMethodBase - Default charset used: ISO-8859-1
content - << "{"stat":"fail","code":5,"message":"system error"}"
HttpMethodBase - Should NOT close connection in response to directive: keep-alive
HttpConnection - Releasing connection back to connection manager.
MultiThreadedHttpConnectionManager - Freeing connection, hostConfig=HostConfiguration[host=https://api.smugmug.com]


Thanks!

Comments

  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 9, 2010
    G'day truist,

    This has been fixed internally, the changes should go live later this week...I'll reply to this thread when they're live.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
  • Options
    devbobodevbobo Registered Users, Retired Mod Posts: 4,339 SmugMug Employee
    edited February 12, 2010
    This issue should be resolved now.

    Cheers,

    David
    David Parry
    SmugMug API Developer
    My Photos
Sign In or Register to comment.