JSend (https://github.com/omniti-labs/jsend) is an extremely simple standard that covers three main categories of response: success, fail, and error. Each type further defines mandatory keys. For example, all three types require a status key. Success and fail require a data key. The error type requires a key called message.Â
Here is an example of a successful response to a GETÂ request:
{
status : "success",
data : {
"posts" : [
{ "id" : "1111AAAA", "productKey" : "1111AAAA", "title" : "Chocolate Bunny" },
{ "id" : "2222BBBB", "productKey" : "2222BBBB", "title" : "Chocolate Donut" }
]
}
}
Next, we will look at JSON:API.