Error handling

Tietoevry is renewing Lifecare Open APIs. End of support is May 1, 2024. Information about new API solution is found at this location: https://apitest.weno.no/docs

Error Response Information

Errors detected and handled by the web server (or any other infrastructure) before the request is passed on to the API service, will usually result in an HTML error page. This can happen if:

  • The request is malformed, and the server does not know what to do with it. Assuming http library is correct, this could be a wrong URL path or query string.
  • The client certificate is not trusted by the web server. Is the root certificate trusted by the server? Does the client certificate provide 1.3.6.1.5.5.7.3.1 in extended key usage? Is the certificate expired? Is the client certificate algorithms known and trusted by the server? Check the log on the server to find the reason the certificate is not trusted.
  • Status is 500, e.g. the API service crashed due to (e.g.)
    • Timeout waiting for a reply, (usually this is the case if the server returns after a long wait and in a round number of seconds; unless the problem i due to load generated by the request itself, the problem will often go away by itself),
    • Connection issues internally,
    • Error in the database, or
    • Programming error.
  • Some other configuration on the server is wrong.

If an error occurs during a request, the following fields will be returned in the response body:

Name Description Type
Status integer
Code string
Message string
CorrelationId string

HTTP Status ServiceCodes

We use the following HTTP status codes:

  • 200 - OK
  • 400 - Bad Request
  • 401 - Unauthorized
  • 403 - Forbidden
  • 404 - Not Found
  • 415 - Unsupported Media Type
  • 500 - Internal Server Error
  • 501 - Not Implemented

Error ServiceCodes

We use the following error codes:

  • AccessDenied
  • AuthenticationFailed
  • BadRequest
  • FeatureNotEnabled
  • InternalServerError
  • NotFound
  • NotImplemented
  • NotSupported
  • ServiceUnavailable
  • Timeout
  • UnsupportedMediaType

Some configuration related errors

Http status Message Solution
403 The application is not enabled for the runtime context: xxx The service owner must enable the api for the given runtime context. (In Lifecare Control Center)
403 Feature not enabled. Feature ID: EC_NO_Integration_API The service owner must configure the api to have status enabled. (In Lifecare Control Center)
403 No client certificate Either the server is not configured to ask for a client certificate, or the client is not providing a client certificate.
403 Client certificate is not authorized The service owner must add the thumbprint of the client certificate (or an intermediate) in the list of trusted client certificates for the runtime context. (In Lifecare control center)
403 Invalid argument: key. Ambiguous API key, ... The key argument is provided in more than one place in the request.
403 Required argument: key. You must define the API key The key argument is not provided
403 The API key is invalid The key argument contains an error. It should be copied verbatim. Error in urlencoding?
403 The API key is expired Get a new key from the service owner.
403 The API key is not authorized for this domain. The key not valid for the given domain (sent in as domain argument)
403 The API key is not authorized for: xxx The key is not valid for the given API call. Get a new key from the service owner with proper authorizations.