[Developers] Freebase API Error response format

David Flanagan david at davidflanagan.com
Fri Mar 28 20:33:37 UTC 2008


While on this topic, what is the officially sanctioned best way to test 
for success of a query?

	David Flanagan

Aseem Mohanty wrote:
> Hi All.
> 
> There is an ongoing internal effort to standardize the error response 
> format for all API service calls. Since the changes are mainly additive 
> in nature, for the most part this should not effect, and more 
> importantly break, any existing applications that parse the error 
> response from Freebase services. This change is in the pipeline is not 
> currently deployed on www.freebase.com or sandbox.freebase.com
> 
> I have outlined the changes below. If it turns out that your application 
> may break because of the changes please let me know and we can try and 
> resolve any issues your application might have.
> 
> Error Response Format:
> FIXED - indicates that the field will be there
> OPT   - indicates that the field may or may not be there
> 
> NOTE: This is a contrived example and should not be considered as a real
> error response.
> 
> {
>     # the HTTP status code for the request, since some services (notably
>     # MQL may return an HTTP 200 for partial error conditions
>     # - FIXED -
>     "status": "400 Bad Request",
> 
>     # Service level code or module to indicate which service failed
>     # - FIXED -
>     "code": "/api/status/error/trans",
> 
>     # Detailed information about what the nature of the error is
>     # - FIXED -
>     "messages": [{
> 
>       # Application level machine-readable error descriptor
>       #  - FIXED -
>       "code": "/api/status/error/image_thumb/image_too_large",
> 
>       # Application level human-readable error description
>       # - FIXED -
>       "message": "The original image is larger than 16 MP and cannot be 
> thumbnailed."
> 
>       # Additional fields that might help in identifying the source of
>       # the error. All remaining fields are optional
>       # - OPT -
>       "id": "/guid/9202.....1234",
>       "dim": "7000x7000"
>       ....
>     }]
>   }
> 
> Thanks.
> Aseem Mohanty
> _______________________________________________
> Developers mailing list
> Developers at freebase.com
> http://lists.freebase.com/mailman/listinfo/developers
> 



More information about the Developers mailing list