Standardized response interface in REST API services for errors

interface APIError {
    code: string;
    detail?: string;
    links?: Links;
    meta?: { [x: string]: any };
    source?: APISource;
    status: number;
    title: string;
    uuid: string;
}

Properties

code: string

REST API specific error code

detail?: string

Human-readable explanation specific to this occurrence of the problem

links?: Links

Links that leads to further details about this particular occurrence of the problem. A link MUST be represented as either:

  • self: a string containing the link’s URL
  • related: an object (“link object”) which can contain the following members:
    • href: a string containing the link’s URL.
    • meta: a meta object containing non-standard meta-information about the link.
meta?: { [x: string]: any }

A meta object containing non-standard meta-information about the error

source?: APISource

An object containing references to the source of the error

status: number

HTTP Status code

title: string

Human-readable summary of problem that SHOULD NOT change from occurrence to occurrence

uuid: string

UUID V4, unique identifier for this particular occurrence of the problem