-
Notifications
You must be signed in to change notification settings - Fork 20
Home
Important!
Requests will be made to
user:password@http://server.com/index.php/apps/marble/api/v1/action
where action can have the following values:
ROUTES
-
Upload route - **/routes/**create
-
Request type:** POST** with these data fields:
-
timestamp: for uniquely identifying the routes
-
kml: the kml file itself (FILE field)
-
preview: image file for previewing the route (FILE field)
-
name: pretty name for the route
-
distance: route length
-
duration: estimated route duration
-
-
Response: JSON the result of the operation: *success */ failure, see below.
-
-
Obtain route list - **/**routes - GET
-
Request type: GET
-
Response: JSON: an array of dictionaries containing:
-
timestamp
-
name
-
distance
-
duration
-
-
-
Download route - /routes/$TIMESTAMP
-
Request type: GET
-
Response: the kml identified by $TIMESTAMP
-
-
Download route preview - /routes/preview/$TIMESTAMP
-
Request type: GET
-
Response: the preview image
-
-
Delete route - /routes/delete/$TIMESTAMP
-
Request type: DELETE
-
Response: the result of the delete operation, see below.
-
-
Rename route - /routes/rename
-
Request type: POST with two fields:
-
timestamp: route’s identifier
-
newName: the new name of the route identified by $TIMESTAMP
-
-
Response: the result of the rename operation, see below.
-
BOOKMARKS
-
Update KML: **/api/v1/**bookmarks/update
-
request: POST with fields:
- bookmarks - the bookmarks kml (as a FILE, not string!)
-
response: status report (JSON - status + timestamp of modification )
-
-
Get KML: /api/v1**/**bookmarks
-
request: GET
-
response: the KML (wrapped in JSON)
-
-
Update JSON: /bookmarks/update
-
request: POST with fields:
- bookmarks - JSON array of bookmarks
-
response: status report (JSON - status + timestamp of modification)
-
-
Get JSON: /bookmarks
-
request: GET
-
response: a JSON array of bookmarks (wrapped in JSON, see below)
-
-
Timestamp: /bookmarks/timestamp
-
request: GET
-
response: a JSON containing a timestamp field.
-
-
External API timestamp: **/api/v1/**bookmarks/timestamp
- request, response: same as above
Responses will be JSON structured like this:
-
"status" : either “success” or “error”
-
"data" : data itself, optional in case of error.
-
"message" : error message, optional in case of success.