Internal GCAPI

From GrandCare Systems
Revision as of 17:45, 1 August 2012 by Ngh (talk | contribs) (Created page with "To access the Como API you first need the passcodes to they system. == GCManage API == * URL: https://gcmanage.grandcare.com/services.php?sname=<serviceName>&username=<userna...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To access the Como API you first need the passcodes to they system.

GCManage API

  • URL: https://gcmanage.grandcare.com/services.php?sname=<serviceName>&username=<username>&rawpassword=<password>
  • Use GET or POST requests
  • Where serviceName corresponds to a valid service name (services listed below)
  • Username is your GCManage username
  • Password is your GCManage password

Remote Login

  • Service Name: remotelogin
  • Results
    • System URL (used to call down to the Como API)
    • Passcode (Como API Authentication code)
    • Account Name
    • System ID

Example

curl -k "https://gcmanage.grandcare.com/services.php?sname=remotelogin&username=foo&rawpassword=bar"
http://gcmanage.grandcare.com:21000/@@UDBvSFB6OC9EeDgxUDBJSFB6OC9hZz09@@main@@Account MyAccount - 314-999998
http://gcmanage.grandcare.com:22000/@@UHo4L0lUOENQeWMvUHo4clB6OC9UUT09@@main@@Account MyAccount2 - 314-999999

<system URL>@@<Passcode>@@main@@<Account Name> - <System ID>

Como API

If you're on the same network as the GrandCare system, you can call directly to it's IP address. If not, you'll need to get the public URL from the GCManage API remotelogin service.

This URL (whether private IP or public address) will be referenced as $SystemAddress in the rest of the documentation.

$SystemAddress Examples

http://gcmanage.grandcare.com:21000/
http://192.168.0.5/
http://10.100.1.5/

History

  • URL: $SystemAddress/api/history.php
  • Global Parameters
    • op: API Operation (see list below)
    • encoding ("json" or "xml")
    • passcode: System passcode from GCManage API

bp (Blood Pressure)

Results

$ curl "http://10.100.1.2/api/history.php?op=bp&encoding=json&passcode=YkdrYUpUOEVVRDhMZFQ4SlB6OC9kdz09"
{
   "gcapi": {
       "result": "SUCCESS",
       "bp": [
           {
               "timestamp": "07/31/12 08:15:57",
               "deviceId": "1001",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "systolic": "134",
               "diastolic": "95",
               "pulse": "54",
               "mean-ap": "117"
           },
           {
               "timestamp": "07/28/12 07:51:16",
               "deviceId": "1001",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "systolic": "134",
               "diastolic": "89",
               "pulse": "51",
               "mean-ap": "104"
           }
       ],
       "totalEntries": "2"
   }
}

weight

Results

$ curl "http://10.100.1.2/api/history.php?op=weight&encoding=json&passcode=YkdrYUpUOEVVRDhMZFQ4SlB6OC9kdz09"
{
   "gcapi": {
       "result": "SUCCESS",
       "weight": [
           {
               "timestamp": "07/31/12 08:14:45",
               "deviceId": "1000",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "value": "176.6"
           },
           {
               "timestamp": "07/28/12 07:49:32",
               "deviceId": "1000",
               "residentId": "cf6ff892-3124-41ef-8c77-e729f0f66fc5",
               "value": "176.2"
           }
       ],
       "totalEntries": "2"
   }
}

temp (Indoor Temperature)

Results

$ curl "http://10.100.1.2/api/history.php?op=temp&encoding=json&passcode=YkdrYUpUOEVVRDhMZFQ4SlB6OC9kdz09"
{
   "gcapi": {
       "result": "SUCCESS",
       "temp": [
           {
               "timestamp": "07/20/12 12:06:18",
               "deviceId": "103",
               "value": "73"
           },
           {
               "timestamp": "07/20/12 11:53:14",
               "deviceId": "103",
               "value": "74"
           }
       ],
       "totalEntries": "2"
   }
}