Response codes and headers

If an error occurs, the REST interface will return HTTP error codes (like 400 User Error, 404 Not Found, 500 Internal Server Error). In addition, a set of headers will be returned with extra information about the error situation.

Almost all responses, including error situations like 404, will include the X-Archive-Error- headers, but there might be situations where you will not receive them (a.e. if using a proxy, and there’s a problem with the proxy itself), so although your code should take advantage of the information in these headers, it should not require that they are present.


Respons headers

Header​Description
​X-Archive-Error-Code​This is a numeric error code meant to facilitate machine handling of specific errors. An overview of current error codes is available in Error codes.
​X-Archive-Error-Message​A human readable description of the error.
​X-Archive-Info-Code​A numeric info code used to report back success for specific operations. So far the only value is -1000, which means "upload succeeded", and is only returned when uploading a document.
​X-Archive-Info-Message​A human readable description of the successful result.
​X-Archive-Index-Name​If a given metadata field is part of an error, this header will contain the field name.
​X-Archive-Index-Value​If a given metadata field is part of an error, this header will contain the field value. This header may be omitted if there is no value associated with the field.
​X-Archive-Status-Code​This field contains the HTTP result code that is returned to the client. If this is missing or do not match the http result code, then either the web service was not able to understand the request (e.g. if a wrong URL is used, or if the http request itself is malformed), or the request/result was modified or intercepted by a proxy. In the latter case, the returned result can not be trusted. This is especially important to check when storing documents, as there has been cases where a proxy has returned 200 OK without even sending the request to E-Archive, thus misleadingly indicate that a document has been successfully stored.