Shutterfly Open API  |  Error Messaging


Shutterfly API's may return domain-specific error messaging if there was a problem with the request. In addition to the HTTP response code, which are defined by the common response codes, the body of the 400 or 500 series response may contain the following XML:

<openfly:error xmlns:openfly="http://openfly.shutterfly.com/v1.0">
<openfly:statuscode>
ErrorCode
</openfly:statuscode>
<openfly:statusmessage>
Message
</openfly:statusmessage>
</openfly:error>

For example, in the order API if you submit a credit card that expired last year you're likely to receive 400 status code response, with the following body:

<openfly:error xmlns:openfly="http://openfly.shutterfly.com/v1.0">
<openfly:statuscode>
12
</openfly:statuscode>
<openfly:statusmessage>
Invalid credit card expiration year
</openfly:statusmessage>
</openfly:error>

In addition, the error status code and message will also be sent in the response header, which may provide easier access than parsing the response body:

X-OPENFLY-STATUSCODE: 12
X-OPENFLY-STATUSMESSAGE: Invalid credit card expiration year

Please refer to the documentation for your API to see the error codes that may be thrown in the error messaging.

Limitations

  1. Not all APIs utilize this error messaging scheme - please refer to the API documentation. Specifically, the upload API does NOT return this XML, the error messaging is contained within custom XML and the HTTP response code is 200.
  2. Only specific, typed exceptions will result in this status messaging - other issues could return no specific information, just the HTTP response code. At that point, you'll need to refer to the common response code documentation to determine whether the issue is likely to be a transient issue or if there is another problem.
© Copyright Shutterfly 1999-2009. All rights reserved.