Difference between revisions of "Internal GCManage API"

From GrandCare Systems
Jump to navigation Jump to search
Line 1: Line 1:
= Introduction =
=Authentication With GCManage 2.0=
GCManage API is used to get passcodes to systems
Before calling any of the [[GCAPI]] services, an application must authenticate and obtain a "passcode" from GCManage. GCManage provides a service to fetch the accounts available to a user and their "passcodes" given the user's name and password. This service is useful when implementing an third-party login page for GCManage or when calling services on [[GCAPI]]. The format for calling this function is:
https://[GCManage-URL]/services.php?sname=LoginService&username=[username]&password=[plain-text-password]&listaccounts=true


* URL: <nowiki>https://gcmanage.grandcare.com/services.php?sname=<serviceName>&username=<username>&rawpassword=<password></nowiki>
The result of the call will be be a JSON encoded string that includes a list of accounts that this user can access:
* Use GET or POST requests
{
* Where serviceName corresponds to a valid service name (services listed below)
    "result": "OK",
* Username is your GCManage username
    "id": "c07c11ee-3a27-47e5-9c81-7857de364cdc",
* Password is your GCManage password
    "lastLogin": "never",
    "accounts": [
        {
            "accountName": "...",
            "systemId": "...",
            "passcode": "...",
            "url": "..."
        },
        ...
    ]
}


== Services ==
* result: OK if the call succeeded, ERROR otherwise
=== Remote Login ===
* errorMessage: Only appears if result is ERROR. Explanation of why call failed
* Service Name: remotelogin
* id: User's unique ID
* Results
* lastLogin: User's last login date/time
** System URL (used to call down to the [[Como API]])
* accounts: Array of accounts this user has access to
** Passcode ([[Como API]] Authentication code)
* accountName: Long name for the account
** Account Name
* systemId: ID of associated hardware for the account
** System ID
* passcode: Effectively the "password" for the system. The passcode changes daily in the very early morning, so it needs to be fetched again every day
* url: Base URL used to communicate with the system


'''Example'''
=Legacy Authentication With GCManage 1.5=
  curl -k "https://gcmanage.grandcare.com/services.php?sname=remotelogin&username=foo&rawpassword=bar"
Authentication was a little different in GCManage 1.5.x:
http://gcmanage.grandcare.com:21000/@@UDBvSFB6OC9EeDgxUDBJSFB6OC9hZz09@@main@@Account MyAccount - 314-999998
  http://[GCManage-URL]/services.php?sname=remotelogin&username=[username]&password=[php-crypted-password]
http://gcmanage.grandcare.com:22000/@@UHo4L0lUOENQeWMvUHo4clB6OC9UUT09@@main@@Account MyAccount2 - 314-999999
 
The result of the call will be be a list of accounts, one per line, that this user can access. Each line is of the format:
<system URL>@@<Passcode>@@main@@<Account Name> - <System ID>
[como-system-url]@@[passcode]@@[starting-point]@@[account-description]
 
* como System URL: The URL to use to get to the system, either proxied or direct, based on the caller's location and other various elements on the server
* passcode: Effectively the "password" for the system. The passcode changes daily in the very early morning, so it needs to be fetched again every day
* Starting Point: The initial menu screen the user sees when connecting to the system. Either "main" for the Main Menu or "tv" for the TV Operations Page
* Account Description: An identifier giving various information about the account

Revision as of 19:53, 2 August 2012

Authentication With GCManage 2.0

Before calling any of the GCAPI services, an application must authenticate and obtain a "passcode" from GCManage. GCManage provides a service to fetch the accounts available to a user and their "passcodes" given the user's name and password. This service is useful when implementing an third-party login page for GCManage or when calling services on GCAPI. The format for calling this function is:

https://[GCManage-URL]/services.php?sname=LoginService&username=[username]&password=[plain-text-password]&listaccounts=true

The result of the call will be be a JSON encoded string that includes a list of accounts that this user can access:

{
   "result": "OK",
   "id": "c07c11ee-3a27-47e5-9c81-7857de364cdc",
   "lastLogin": "never",
   "accounts": [
       {
           "accountName": "...",
           "systemId": "...",
           "passcode": "...",
           "url": "..."
       },
       ... 
   ]
}
  • result: OK if the call succeeded, ERROR otherwise
  • errorMessage: Only appears if result is ERROR. Explanation of why call failed
  • id: User's unique ID
  • lastLogin: User's last login date/time
  • accounts: Array of accounts this user has access to
  • accountName: Long name for the account
  • systemId: ID of associated hardware for the account
  • passcode: Effectively the "password" for the system. The passcode changes daily in the very early morning, so it needs to be fetched again every day
  • url: Base URL used to communicate with the system

Legacy Authentication With GCManage 1.5

Authentication was a little different in GCManage 1.5.x:

http://[GCManage-URL]/services.php?sname=remotelogin&username=[username]&password=[php-crypted-password]

The result of the call will be be a list of accounts, one per line, that this user can access. Each line is of the format:

[como-system-url]@@[passcode]@@[starting-point]@@[account-description]
  • como System URL: The URL to use to get to the system, either proxied or direct, based on the caller's location and other various elements on the server
  • passcode: Effectively the "password" for the system. The passcode changes daily in the very early morning, so it needs to be fetched again every day
  • Starting Point: The initial menu screen the user sees when connecting to the system. Either "main" for the Main Menu or "tv" for the TV Operations Page
  • Account Description: An identifier giving various information about the account