This repository has been archived by the owner on Apr 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Mobile API Design Overview
islands edited this page Jun 5, 2011
·
9 revisions
Our api is a json envelope
{"status":$status, "data":$data}
Where $status is "success" or "fail" and $data is either: In case of "success": data package (object, described below), In case of "fail": failure message (string, describing error message).
-
Input: none
-
Output: Returns json list of all food trucks
-
Example:
{
"data": [
{
"id": "2",
"info": "test",
"lat": "21.2927",
"lng": "-157.793",
"name": "Jason Axelson"
},
{
"id": "1",
"info": "test",
"lat": "21.292",
"lng": "-157.85",
"name": "austenito"
}
],
"status": "success"
}
- Use: Get details about a truck by id, including their current location.
- Input: none (besides the id in the url)
- Output: json information about a single food truck
- Use: to test client side error handling
- Input: none
- Output: Returns failed command ('status':'fail')
- id: a unique id for the truck, this the Primary Key in the trucks table.
- lat: Latitude of the most recent tweet that has a non-null value
- long: Longitude of the most recent tweet that has a non-null-value
- name: full name of food truck (currently shows twitter account name, TO BE REVISED)
- logo: food truck logo (get from Poni? NOT YET IMPLEMENTED)
- info: twitter account info (NOT YET IMPLEMENTED, just shows 'test' for now)
- We do not store or return trucks previous locations.
- Currently don't support anything about menus or specials.