User Tools

Site Tools


web:access_rest_api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
web:access_rest_api [2016/01/29 18:02]
mjallison [Method Breakdown]
web:access_rest_api [2016/02/09 00:25] (current)
mjallison [Responses]
Line 18: Line 18:
      * May need separate instance of REST API for each machine to avoid cross site scripting calls. ​      * May need separate instance of REST API for each machine to avoid cross site scripting calls. ​
   * REST API perhaps used for background operations in IOS operations.   * REST API perhaps used for background operations in IOS operations.
 +
 +===== Responses =====
 +If the method succeeds, ack is true. Any error will cause ack to be false, and code set to the StorageException value returned by the server. In most cases the string value err is set to the description provided by the error. ​
 +
 +   { ack: true|false,
 +     code: 0 | code,
 +     err: "error description"​
 +   }
 +
 +Other JSON structures may be returned from a method. In each case the objects returned are wrapped as a GenericResponse. For instance getAllAnnouncements() returns
 +
 +   { ack: true|false
 +     code: 0 | code,
 +     err : "error description"​
 +     [ Announcement* ]
 +   }
 + 
 +Where **Announcement** is:
 +   {
 +      id: integer,
 +      expire: long, (mSec)
 +      text: "​String of announcement"​
 +   ​}  ​
 +  ​
 +Other return objects possible are:
 +**StoredItem**
 +   {
 +      handle ​     : int-value,
 +      name        : string,
 +      description : string,
 +      isFolder ​   : boolean,
 +      size        : long,
 +      children: [ StoredItem* ]
 +   }
 +   
 +**ApplicationState** return from connection/​open or connection/​check
 +   {
 +      userid: string,
 +      token: string,
 +      lastPath: string,
 +      hasAccess: boolean,
 +      hasLicense: boolean,
 +      hasTracks: boolean,
 +      isAdmin: boolean,
 +      isSupport: boolean
 +   }
 +   
 +**AccountInfo**
 +   {
 +      user: string,
 +      userid: string,
 +      totalSpace: long,
 +      usedSpace: long
 +   }
 +   
 +**StorageUser** (minimal needed for admin functions)
 +   {
 +      handle: integer,
 +      customerId: string,
 +      userId: string,
 +      firstName: string,
 +      lastName: string,
 +      phone: string,
 +      role: string
 +   }
 +   
 +**LicenseKey** (minimal needed for admin functions)
 +   {
 +      handle: integer,
 +      type: integer,
 +      number: string,
 +      customerId: string,
 +      maxCheckoutPeriod:​ long,
 +      dueDate: long,
 +      checkoutUser:​ string,
 +      checkoutUserPhone:​ string
 +   }
 +   
 +**Project**
 +   {
 +      handle: integer,
 +      name: string,
 +      description:​ string,
 +      lastTrackTime:​ long,
 +      modifiedTime:​ long,
 +      status: integer,
 +      trackCount: integer
 +   }
 +   
 +**WorkingTime**
 +   {
 +      projectHandle:​ integer,
 +      dayStart: long,
 +      morningStart:​ long,
 +      clipToStart:​ boolean,
 +      morningEnd: long,
 +      clipToMidday:​ boolean,
 +      afternoonStart:​ long,
 +      clipToEnd: boolean,
 +      afternoonEnd:​ long
 +   }
 +   
 +**Track**
 +   {
 +      handle: integer,
 +      trackerAlias:​ string,
 +      trackerSerial:​ string,
 +      projectHandle:​ integer,
 +      discoveryTime:​ long,
 +      startTime: long,
 +      endTime: long,
 +      totalPoints:​ long,
 +      fixType: integer, ​
 +      attributes: object
 +   }
 +   
 +**TrackPoints**
 +   {
 +      count: integer,
 +      [ Point ]
 +   }
 +   
 +**Point**
 +   {
 +      time: long,
 +      lat: double,
 +      lon: double,
 +      alt: double
 +   }
 +   
 +**Tracker**
 +   {
 +      serial: string,
 +      alias: string,
 +      lastLat: double,
 +      lastLon: double,
 +      lastAlt: double,
 +      lastTime: long,
 +      totalPoints:​ integer
 +   }
 +  ​
 +**Telemetry**
 +   {
 +      serial: string,
 +      time: long,
 +      channel: int,
 +      value: numeric | string (depends on channel type)
 +   }
 +   
 +**Vehicle**
 +   {
 +      assetId: string,
 +      type: integer,
 +      status: integer,
 +      description:​ string,
 +      color: integer, (RGBA 32bit value)
 +      avgLoad: double
 +   }
 +
 ===== Method Breakdown ===== ===== Method Breakdown =====
  
-| **API-class (priority)** | **Method Name** ​  | **Return Value** ​ | **REST Method** | **Notes** | +| **API-class (priority)** | **Method Name** ​  | **Return Value** ​ | **REST Method** | **params** | **return** | **Notes** | 
 | CONNECTION (0) |                             ​| ​                  | | | | CONNECTION (0) |                             ​| ​                  | | |
-|                | connect() ​                  | StorageServer ​    | GET  | | +|                | connect() ​                  | StorageServer ​    | GET  | userid,​password,​token | GR |  
-|                | authenticate()              |                   ​| ​PUT  | | +|                | connectResetPassword()      |                   ​| ​GET  ​| ​userid,​password ​GR **still needed** ​
-|                | authenticateResetPassword() |                   | PUT  ​| | +|                | disconnect() ​               |                   | PUT  | | GR |  
-|                | disconnect() ​               |                   | PUT  | | +|                | getAnnouncements()          | Announcement* ​    | GET  | | GR [ Announcement ] |
-|                | getAllAnnouncements()       ​| Announcement* ​    | GET  | |+
 | ASSOCIATION (4) |                            |                   | | | | ASSOCIATION (4) |                            |                   | | |
-|                | getAssociations() ​          | Association* ​     | | | +|                | getAssociations() ​          | Association* ​     | GET  ​| | 
-|                | addAssociation() ​           | Association ​      | | | +|                | addAssociation() ​           | Association ​      ​| ​PUT  ​| | 
-|                | updateAssociation() ​        | Association ​      | | | +|                | updateAssociation() ​        | Association ​      ​| ​PUT  ​| | 
-|                | deleteAssociation() ​        | Association ​      | | |+|                | deleteAssociation() ​        | Association ​      ​| ​PUT  ​| |
 | CONFIGURATION (4) |                          |                   | | | | CONFIGURATION (4) |                          |                   | | |
-|                | getAllConfigurations() ​     | Configuration* ​   | | | +|                | getAllConfigurations() ​     | Configuration* ​   | GET  ​| | 
-|                | getConfiguration() ​         | Configuration ​    | | | +|                | getConfiguration() ​         | Configuration ​    ​| ​GET  ​| | 
-|                | updateConfiguration() ​      | Configuration ​    | | | +|                | updateConfiguration() ​      | Configuration ​    ​| ​PUT  ​| | 
-|                | getConfigurationData() ​     | ConfigurationData | | | +|                | getConfigurationData() ​     | ConfigurationData | POST | | 
-|                | setConfigurationData() ​     | void              | | |+|                | setConfigurationData() ​     | void              | POST | |
 | FILEAPI (1)    |                             ​| ​                  | | | | FILEAPI (1)    |                             ​| ​                  | | |
-|                | createFolder() ​             | StoredFolder ​     | GET  | | +|                | createFolder() ​             | StoredFolder ​     | GET  | path | GR { stedFolder } 
-|                | createPublicUrl() ​          | String url        | GET  | | +|                | createPublicUrl() ​          | String url        | GET  | path | GR { url } 
-|                | deleteFile() ​               | void              | PUT  | | +|                | deleteFile() ​               | void              | PUT  | path | GR 
-|                | deletePublicUrl() ​          | void              | PUT  | | +|                | deletePublicUrl() ​          | void              | PUT  | path | GR 
-|                | downloadFile() ​             |                   | GET  | to file... tbd | +|                | downloadFile() ​             |                   | GET  ​| path | | to file... tbd | 
-|                | downloadVersion() ​          ​| ​                  | GET  | to file... tbd |  +|                | downloadVersion() ​          ​| ​                  | GET  ​| path | | to file... tbd |  
-|                | getAccountInfo() ​           |                   | GET  | | +|                | getAccountInfo() ​           |                   | GET  | | GR { AccountInfo } 
-|                | getFolder() ​                | StoredFolder ​     | GET  | |+|                | getFolder() ​                | StoredFolder ​     | GET  | ??? |
 |                | getVersions() ​              | StoredFile+ ​      | GET  | | |                | getVersions() ​              | StoredFile+ ​      | GET  | |
 |                | getStoredFile() ​            | StoredFile ​       | GET  | | |                | getStoredFile() ​            | StoredFile ​       | GET  | |
-|                | moveFile() ​                 | void              | PUT  | | +|                | moveFile() ​                 | void              | PUT  | path, dstpath | GR |  
-|                | renameFile() ​               | void              | PUT  | | +|                | renameFile() ​               | void              | PUT  | path, newname | GR |  
-|                | renameFolder() ​             | void              | PUT  | | +|                | renameFolder() ​             | void              | PUT  | path, newname | GR 
-|                | setDescription() ​           | void              | PUT  | | +|                | setDescription() ​           | void              | PUT  | path, description ​
-|                | uploadFolder() ​             | StoredFolder ​     | POST | | +|                | uploadFolder() ​             | StoredFolder ​     | POST | ??? 
-|                | uploadFile() ​               | StoredFile ​       | POST | |+|                | uploadFile() ​               | StoredFile ​       | POST | ??? |
 | PROJECTS (2)   ​| ​                            ​| ​                  | | | | PROJECTS (2)   ​| ​                            ​| ​                  | | |
 |                | addProject() ​               | Project ​          | PUT  | | |                | addProject() ​               | Project ​          | PUT  | |
Line 62: Line 220:
 |                | archiveProject() ​           | StoredFile ​       | POST | | |                | archiveProject() ​           | StoredFile ​       | POST | |
 |                | restoreProject() ​           | Project ​          | POST | | |                | restoreProject() ​           | Project ​          | POST | |
-|                | getWorkingTime() ​           | WorkingTime ​      | GET  | for a day | +|                | getWorkingTime() ​           | WorkingTime ​      | GET  ​| | | for a day | 
-|                | getWorkingTime() ​           | WorkingTime* ​     | GET  | for a range of times |+|                | getWorkingTime() ​           | WorkingTime* ​     | GET  ​| | | for a range of times |
 |                | updatingWorkingTime() ​      | WorkingTime ​      | PUT  | | |                | updatingWorkingTime() ​      | WorkingTime ​      | PUT  | |
 |                | deleteWorkingTime() ​        | void              | PUT  | | |                | deleteWorkingTime() ​        | void              | PUT  | |
Line 71: Line 229:
 |                | runReport() ​                | void              | POST | | |                | runReport() ​                | void              | POST | |
 |                | getActiveProducts() ​        | String+ ​          | GET  | | |                | getActiveProducts() ​        | String+ ​          | GET  | |
-| ADMIN  (3)     ​| ​                            ​| ​                  | | All are customer admin functions as defined in current API | +| ADMIN  (3)     ​| ​                            ​| ​                  | | | | All are customer admin functions as defined in current API | 
-|                | getUsers() ​                 | StorageUser* ​     | | | +|                | getUsers() ​                 | StorageUser* ​     | GET  ​| | 
-|                | addUser() ​                  | StorageUser ​      | | | +|                | addUser() ​                  | StorageUser ​      ​| ​PUT  ​| | 
-|                | deleteUser() ​               | boolean ​          | | |  +|                | deleteUser() ​               | boolean ​          ​| ​PUT  ​| |  
-|                | updateUser() ​               | StorageUser ​      | | | +|                | updateUser() ​               | StorageUser ​      ​| ​PUT  ​| | 
-|                | getAllLicenses() ​           | LicenseKey* ​      | | | +|                | getAllLicenses() ​           | LicenseKey* ​      ​| ​GET  ​| | 
-|                | removeLicenseUser() ​        | void              | | | +|                | removeLicenseUser() ​        | void              | PUT  ​| | 
-|                | addLicenseUser() ​           | void              | | | +|                | addLicenseUser() ​           | void              | PUT  ​| | 
-|                | updateLicenseCheckoutTime() | LicenseKey ​       | | | +|                | updateLicenseCheckoutTime() | LicenseKey ​       | PUT  ​| | 
-|                | getLicenseLog() ​            ​| ​                  | | | +|                | getLicenseLog() ​            ​| ​                  ​| ​GET  ​| | 
-| LICENSE ​ (5)   ​| ​                            ​| ​                  | | Not supported in V1 +| LICENSE ​ (5)   ​| ​                            ​| ​                  | | | | Needed for web apps at all? 
-|                | getLicenses() ​              | LicenseKey* ​      | | | +|                | getLicenses() ​              | LicenseKey* ​      ​| ​GET  ​| | 
-|                | checkoutLicense() ​          | LicenseKey ​       | | | +|                | checkoutLicense() ​          | LicenseKey ​       | PUT  ​| | 
-|                | checkinLicense() ​           | LicenseKey ​       | | | +|                | checkinLicense() ​           | LicenseKey ​       | PUT  ​| | 
-|                | renewLicense() ​             | LicenseKey ​       | | | +|                | renewLicense() ​             | LicenseKey ​       | PUT  ​| | 
-|                | submitLicenseComment() ​     | void              | | | +|                | submitLicenseComment() ​     | void              | PUT  ​| | 
-| SUPPORT ​ (5)   ​| ​                            ​| ​                  | | Limited to viewing only operations |  +| SUPPORT ​ (5)   ​| ​                            ​| ​                  | | | | Limited to viewing only operations |  
-|                | getConfig() ​                | Config ​           | | | +|                | getConfig() ​                | Config ​           | GET  ​| | 
-|                | getCustomers() ​             | StorageCustomer* ​ | | | +|                | getCustomers() ​             | StorageCustomer* ​ | GET  ​| | 
-|                | getCustomerByLicense() ​     | StorageCustomer ​  | | | +|                | getCustomerByLicense() ​     | StorageCustomer ​  ​| ​GET  ​| | 
-|                | getCustomerByUser() ​        | StorageCustomer ​  | | | +|                | getCustomerByUser() ​        | StorageCustomer ​  ​| ​GET  ​| | 
-|                | getUsers() ​                 | StorageUser ​      | | | +|                | getUsers() ​                 | StorageUser ​      ​| ​GET  ​| | 
-|                | findUsersByPattern() ​       | StorageUser ​      | | | +|                | findUsersByPattern() ​       | StorageUser ​      ​| ​GET  ​| | 
-|                | runReport() ​                ​| ​                  | | |+|                | runReport() ​                ​| ​                  ​| ​POST | |
 |                | <​del>​addCustomerUser()</​del> ​   | StorageUser ​      | | | |                | <​del>​addCustomerUser()</​del> ​   | StorageUser ​      | | |
 |                | <​del>​addAnnouncement() </​del> ​  | Announcement ​     | | | |                | <​del>​addAnnouncement() </​del> ​  | Announcement ​     | | |
Line 106: Line 264:
 |                | <​del>​addCustomer()</​del> ​       | StorageCustomer ​  | | | |                | <​del>​addCustomer()</​del> ​       | StorageCustomer ​  | | |
 |                | <​del>​updateCustomer()</​del> ​    | void              | | | |                | <​del>​updateCustomer()</​del> ​    | void              | | |
-|                | <​del>​getEvents()</​del> ​         | String* ​          | | Server event list |+|                | <​del>​getEvents()</​del> ​         | String* ​          | | | | Server event list |
 |                | <​del>​getApps() </​del> ​          | Application ​      | | | |                | <​del>​getApps() </​del> ​          | Application ​      | | |
 |                | <​del>​updateApp() </​del> ​        ​| ​                  | | | |                | <​del>​updateApp() </​del> ​        ​| ​                  | | |
-| TRACKING (4)   ​| ​                            ​| ​                  | | Plus traditional POSITION API |  +| TRACKING (4)   ​| ​                            ​| ​                  | | | | Plus traditional POSITION API |  
-|                | getSerialNumbers() ​         | String* ​          | | | +|                | getSerialNumbers() ​         | String* ​          ​| ​GET  ​| | 
-|                | updateGpsStats() ​           | GpsStat ​          | | |  +|                | updateGpsStats() ​           | GpsStat ​          ​| ​PUT  ​| |  
-|                | updateGpsStats() ​           | GpsStat ​          | | inp telemetry, needed in web? | +|                | updateGpsStats() ​           | GpsStat ​          | PUT  | | | inp telemetry, needed in web? | 
-|                | getGpsStats() ​              | GpsStat+ ​         | | |  +|                | getGpsStats() ​              | GpsStat+ ​         | GET  ​| |  
-|                | getGpsTelemetry() ​          | GpsTelemetry ​     | | | +|                | getGpsTelemetry() ​          | GpsTelemetry ​     | GET  ​| | 
-|                | getTracks() ​                | Track* ​           | | | +|                | getTracks() ​                | Track* ​           | GET  ​| | 
-|                | getTrack() ​                 | Track             | | | +|                | getTrack() ​                 | Track             ​| ​GET  ​| | 
-|                | deleteTrack() ​              | void              | | | +|                | deleteTrack() ​              | void              | PUT  ​| | 
-|                | moveTrack() ​                | Track             | | |  +|                | moveTrack() ​                | Track             ​| ​PUT  ​| |  
-|                | combineTrack() ​             | Track             | | |  +|                | combineTrack() ​             | Track             ​| ​PUT  ​| |  
-|                | updateTrack() ​              | void              | | | +|                | updateTrack() ​              | void              | PUT  ​| | 
-|                | getTrackStats() ​            | TrackStats ​       | | |  +|                | getTrackStats() ​            | TrackStats ​       | GET  ​| |  
-|                | getTrackSummaryStats() ​     | TrackStats ​       | | |  +|                | getTrackSummaryStats() ​     | TrackStats ​       | GET  ​| |  
-|                | updateTrackStats() ​         | TrackStats ​       | | | +|                | updateTrackStats() ​         | TrackStats ​       | PUT  ​| | 
 | VEHICLES (4)   ​| ​                            ​| ​                  | | | | VEHICLES (4)   ​| ​                            ​| ​                  | | |
-|                | getVehicles() ​              | Vehicle* ​         | | | +|                | getVehicles() ​              | Vehicle* ​         | GET  ​| | 
-|                | addVehicle() ​               | Vehicle ​          | | | +|                | addVehicle() ​               | Vehicle ​          ​| ​PUT  ​| | 
-|                | updateVehicle() ​            | Vehicle ​          ​| ​ | | +|                | updateVehicle() ​            | Vehicle ​          ​| ​PUT  | | 
-|                | deleteVehicle() ​            | Vehicle ​          ​| ​ | |+|                | deleteVehicle() ​            | Vehicle ​          ​| ​PUT  | |
  
web/access_rest_api.1454090563.txt.gz · Last modified: 2016/01/29 18:02 by mjallison