A Shutterfly API may return additional messaging if there was a problem with the request. In addition to the HTTP status code, whose uses are given by the common response codes document, Shutterfly may send an HTTP response body along with a 4xx or 5xx status code. That body may contain plain text, or it may contain XML like this:
<openfly:error xmlns:openfly="http://openfly.shutterfly.com/v1.0"> <openfly:statuscode> [some APIs-specific error code] </openfly:statuscode> <openfly:statusmessage> [some API-specific message] </openfly:statusmessage> </openfly:error>
For example, in the order API, if you submit a credit card that expired last year, you are likely to receive a 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 above error status code and message will also be sent as response headers, 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 the specific API to see the error codes that may be thrown in the error messaging.
If you contact Shutterfly for support, please tell us the above information.
Not all APIs return additional error messaging as shown above; please refer to the API documentation. Specifically,
- the upload API does NOT return the above XML; the error messaging is contained within custom XML and the HTTP status code is always 200.
- Some API errors could return no specific information, just the HTTP status code. At that point, you'll need to refer to the common response codes document to determine whether the issue is likely to be a transient issue or if there is another problem.