Skip to content

Instantly share code, notes, and snippets.

@akexorcist
Last active April 14, 2017 09:18
Show Gist options
  • Save akexorcist/ea300bb59b477ae04a68a59ea95c572c to your computer and use it in GitHub Desktop.
Save akexorcist/ea300bb59b477ae04a68a59ea95c572c to your computer and use it in GitHub Desktop.
Example JSON for NongBeer app
// Successful
{
"status": "SUCCESS",
"message": "Retrieve the list of beer successfully.",
"nextBeerAvailable": true,
"nextBeerIndex": 1,
"beers": [
{
"id": "0102023",
"name": "Hoegaarden",
"price": 300,
"volume": "300ml",
"alcohol": "Alc 7.2% vol",
"image": "www.photobucket.com/s1043/adsacviosdfwel.jpg"
},
{
"id": "0104582",
"name": "U Beer",
"price": 80,
"volume": "620ml",
"alcohol": "Alc 5% vol",
"image": "www.photobucket.com/s1043/adslfhkweiofldglkdx.jpg"
}
]
}
// Unexpected Error
{
"status": "UNEXPECTED_ERROR",
"message": "Something went wrong. Please try again later."
}
// Successful
{
"status": "SUCCESS",
"message": "Retrieve the list of order successfully.",
"nextOrderAvailable": true,
"nextOrderIndex": 2,
"orders": [
{
"id": "939506",
"status": "DELIVERED|UPCOMING",
"date": "03/03/2017",
"time": "23:04",
"totalPrice": 3000,
"totalAmount": 20,
"location": {
"latitude": 13.7413877,
"longitude": 100.573252
},
"beers": [
{
"id": "93024",
"name": "U Beer",
"price": 80,
"amount": 10,
"image": "www.photobucket.com/s93lkewfl/askldjcb03lksdf.jpg"
},
{
"id": "93030",
"name": "Singha",
"price": 100,
"amount": 5,
"image": "www.photobucket.com/s93lkewfl/askldjcb03sglkdfdkgjf.jpg"
}
]
}
]
}
// Token Expired
{
"status": "TOKEN_EXPIRED",
"message": "Please login again."
}
// Unexpected Error
{
"status": "UNEXPECTED_ERROR",
"message": "Something went wrong. Please try again later."
}
{
"location": {
"latitude": 13.34593845,
"longitude": 100.87554345
},
"beers": [
{
"id": "23042057",
"amount": 10
}
]
}
// Successful
{
"status": "SUCCESS",
"message": "We have received your information successfully."
}
// Invalid argument
{
"status": "INVALID_ARGUMENT",
"message": "Missing some argument. Please check and try again"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment