Some of you may know I created a Web API template or framework and the API will return a standard format of JSON response.
For example:
URL: https://api.puterise.com:19900/v1/topic
The response looks like this:
What are those key initials mean?
You may guess:
s = Status (ok or error/failed)
e = Errors
m = Messages
r = Results/Response data/Database query rows
a = code?
Why “a” represents the Status code?
How I came with these initial codes?
The background is coming from a commercial public API I was working on during my previous job. If I am not mistaken, it is from GDex, a logistics service provider.
But some keys are not exists in that API. I added “a” in the JSON response later in my API. I would have used a letter “c” but I ended up using a letter “a”.
This come from the combination of these letters. If I rearrange the letters, I can produce a word “MESRA” which means “friendly” in Malays (my national language). But beware, if you may also rearrange the letters to another word, “SERAM” which mean “scary” in Malays. ?
For example:
URL: https://api.puterise.com:19900/v1/topic
The response looks like this:
JSON:
{
"a": 200,
"r": [
{
"topic": "B4X (default)"
}
],
"s": "ok",
"e": null,
"m": "Success"
}
What are those key initials mean?
You may guess:
s = Status (ok or error/failed)
e = Errors
m = Messages
r = Results/Response data/Database query rows
a = code?
Why “a” represents the Status code?
How I came with these initial codes?
The background is coming from a commercial public API I was working on during my previous job. If I am not mistaken, it is from GDex, a logistics service provider.
But some keys are not exists in that API. I added “a” in the JSON response later in my API. I would have used a letter “c” but I ended up using a letter “a”.
This come from the combination of these letters. If I rearrange the letters, I can produce a word “MESRA” which means “friendly” in Malays (my national language). But beware, if you may also rearrange the letters to another word, “SERAM” which mean “scary” in Malays. ?
Last edited: