Skip to content
This repository has been archived by the owner on Nov 2, 2018. It is now read-only.
Erik Pellikka edited this page Feb 4, 2016 · 1 revision

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

  1. Upload route - **/routes/**create

    1. Request type:** POST** with these data fields:

      1. timestamp: for uniquely identifying the routes

      2. kml: the kml file itself (FILE field)

      3. preview: image file for previewing the route (FILE field)

      4. name: pretty name for the route

      5. distance: route length

      6. duration: estimated route duration

    2. Response: JSON the result of the operation: *success */ failure, see below.

  2. Obtain route list - **/**routes - GET

    1. Request type: GET

    2. Response: JSON: an array of dictionaries containing:

      1. timestamp

      2. name

      3. distance

      4. duration

  3. Download route - /routes/$TIMESTAMP

    1. Request type: GET

    2. Response: the kml identified by $TIMESTAMP

  4. Download route preview - /routes/preview/$TIMESTAMP

    1. Request type: GET

    2. Response: the preview image

  5. Delete route - /routes/delete/$TIMESTAMP

    1. Request type: DELETE

    2. Response: the result of the delete operation, see below.

  6. Rename route - /routes/rename

    1. Request type: POST with two fields:

      1. timestamp: route’s identifier

      2. newName: the new name of the route identified by $TIMESTAMP

    2. Response: the result of the rename operation, see below.

BOOKMARKS

  1. Update KML: **/api/v1/**bookmarks/update

    1. request: POST with fields:

      1. bookmarks - the bookmarks kml (as a FILE, not string!)
    2. response: status report (JSON - status + timestamp of modification )

  2. Get KML: /api/v1**/**bookmarks

    1. request: GET

    2. response: the KML (wrapped in JSON)

  3. Update JSON: /bookmarks/update

    1. request: POST with fields:

      1. bookmarks - JSON array of bookmarks
    2. response: status report (JSON - status + timestamp of modification)

  4. Get JSON: /bookmarks

    1. request: GET

    2. response: a JSON array of bookmarks (wrapped in JSON, see below)

  5. Timestamp: /bookmarks/timestamp

    1. request: GET

    2. response: a JSON containing a timestamp field.

  6. External API timestamp: **/api/v1/**bookmarks/timestamp

    1. 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.

Clone this wiki locally