I'm trying to make an API sorta loosly based on StackExchange's api results.
So here's my json output.
{
"items" : [ ... objects in here .... ]
"page" :
"page_size" :
"total_pages" :
"total_items_count" :
"maximum_quota" :
"remaining_quota" :
}
pretty damn simple.
Now, I'm not sure what do to if the person tries to request a .. um .. product or question or whatever, and the item doesn't exist.
eg..
{
"items": []
... snipped ....
}
I was thinking I would return a 200 AND the Json above, with the Items property being empty.
The other idea I had was returning that json with the items property empty BUT setting the response http status to 404.
Thoughts / standards ?
I really want to return the json no matter what. Why? the quota's. Even an empty result is still a legit hit to the api service.