Basically just looking for input or a thumbsup if it looks ok to you.
I'm wanting to create a simple, standardized json format. My app isn't that complicated, and I want to keep things thin, so I'm basically using a 'best of' mashup of various JSON return standards.
Every Json request will return a standard set of variables along with any specific data that was requested. I know this adds some extra, sometimes unneccesary payload to each request, but I want to keep things consistent.
resource = url
function = name of service
status = error/success
message = message body for error codes or other generic info
data = specific function data
IP = ip of client
date = timestamp of request
I'm wanting to create a simple, standardized json format. My app isn't that complicated, and I want to keep things thin, so I'm basically using a 'best of' mashup of various JSON return standards.
Every Json request will return a standard set of variables along with any specific data that was requested. I know this adds some extra, sometimes unneccesary payload to each request, but I want to keep things consistent.
resource = url
function = name of service
status = error/success
message = message body for error codes or other generic info
data = specific function data
IP = ip of client
date = timestamp of request
Code:
<!--- example return JSON --->
{
"resource": "https://my.com/users.cfc",
"function": "functionName",
"status": "success",
"message": "",
"data": "123123",
"IP": "98.78.211.33",
"date": "2015-07-17 06:03:30"
}
Code:
<!--- example return JSON --->
{
"resource": "https://my.com/users.cfc",
"function": "functionName",
"status": "error",
"message": "database error",
"data": "",
"IP": "98.78.211.33",
"date": "2015-07-17 06:03:30"
}
Last edited: