Open APIs

 View Only
  • 1.  TMFORUM API: JSON error body

    Posted Jun 13, 2017 11:37
    Is there a standard which defines the body of JSON responses in case of errors/fault? Such as the following example:

    {

      "error": {

        "code": "500",

        "title": "Server is down"

      },

       "detail": "Server is in invalid status"

       "userMessage":"The service is temporarily unavailable. "

    }



    ------------------------------
    Andrea Luciano
    ------------------------------


  • 2.  RE: TMFORUM API: JSON error body

    Posted Jun 14, 2017 00:53
    Hi Andrea,

    Currently we are sending the error response as per following schema:

    {
        "$schema": "http://json-schema.org/draft-04/schema#",
     "title": "Error",
        "description": "Error response structure",
        "properties": {
            "code": {
                "id": "/properties/code",
                "type": "integer"
            },
            "description": {
                "id": "/properties/description",
                "type": "String"
            },
            "infoURL": {
                "id": "/properties/infoURL",
                "type": "String"
            },
            "message": {
                "id": "/properties/message",
                "type": "string"
            }
        },
        "type": "object"
    }


    We have defined application level error code and messages which are set in the error object. The HTTP status codes are set as per standard.
    Below is java code snippet.
    Response.status(Response.Status.BAD_REQUEST).entity(error).build();

    ------------------------------
    Vishal Srivastava
    SOPRA STERIA GROUP INDIA
    ------------------------------



  • 3.  RE: TMFORUM API: JSON error body

    Posted Jun 14, 2017 12:39
    Hi Vishal,

         thank you very much for your example, but I'd like to know if there existed a proposal of standard definition in the case of TMFORUM API.

         Kind regards.


    ------------------------------
    Andrea Luciano

    ------------------------------