Dictionary of Api Codes?

apiHackerapiHacker Registered Users Posts: 2 Beginner grinner
Hello,

I am trying to understand why a particular api end point is failing. Unfortunately I cannot find any documentation regarding the internal 'codes' smugmug uses. Additionally, the responses are so generic there is no way to intelligently determine what the error reason is. Having worked on over 30 different api endpoints, this is up there with the most useless responses.

So can someone please tell me what:
{"stat":"fail","code":5,"message":"system error"}

Means in the context of uploading an image? Is the system over capacity, is the method signed wrong, is it a duplicate file, does it meet some other unpublished application limitation, are we rate limited, is our request formatted bad, are we not authorized, why the hell do I get an Http 200?

Insight would be appreciated.

Comments

  • AllenAllen Registered Users Posts: 10,013 Major grins
    edited October 11, 2012
    Did you "Google" "Dictionary of Api Codes"?
    Al - Just a volunteer here having fun
    My Website index | My Blog
  • apiHackerapiHacker Registered Users Posts: 2 Beginner grinner
    edited October 11, 2012
    Yep...didn't see any smugmug specific listing of api codes. In my experience most service providers will utilize the actual http code. Since everything seems to be a 200 and requires inspection of the response body, you would think custom codes smugmug provides would be more readily documented. We really would like to be able acknowledge whatever they are trying to tell us. Since some requests process fine and some dont we are in a sticky situation - - should we just keep retrying all 30k queued up actions? I'm sure they wont appreciate it especially when we retry on failure.
  • rainforest1155rainforest1155 Registered Users Posts: 4,566 Major grins
    edited October 12, 2012
    I'm no developer, but it might be helpful if you could post the detailed API request you sent and the full response you received.
    Sebastian
    SmugMug Support Hero
  • David PLDavid PL Registered Users Posts: 80 Big grins
    edited October 12, 2012
    apiHacker wrote: »
    ...

    So can someone please tell me what:
    {"stat":"fail","code":5,"message":"system error"}

    Means in the context of uploading an image? Is the system over capacity, is the method signed wrong, is it a duplicate file, does it meet some other unpublished application limitation, are we rate limited, is our request formatted bad, are we not authorized, why the hell do I get an Http 200?

    I would also like to see all of the possible error codes identified (in particular for uploading) to allow for more robust error handling by applications using the api.

    From my own testing with the API, it seems that in the context of uploading, Error 5 (system error) is returned for any instance where an upload was made but rejected by SmugMug. If you then go into your SmugMug upload log (in your control panel), that provides more descriptive details of the actual error (such as, invalid file type, incomplete file, etc). It would be very helpful if that same logic already in place that is used to generate the upload error log would be part of the API's error response logic. For example, instead of "system error" as the message, use the same message that would be added to the upload log ("invalid file type", etc). That would provide very useful information that we could build into our applications to better determine what action our application should take (notify user for how to correct the problem file, not have our application retry upload of the same file if it is inevitable retrying will fail, etc).
Sign In or Register to comment.