ack method

Returns the string “ack”. Used for confirming a connection to the server.

Parameters

None.

Returns

The string “ack”.

Errors

None.

Example
ack

"ack"
		

getDate method

Returns a string containing the current date/time on the server.

Parameters

None.

Returns

A string containing the current date/time on the server.

Errors

None.

Example
getDate

"2013-11-27T11:01:51.1687458-05:00"
		

newGuid method

Returns a string containing a new unique identifier.

Parameters

None.

Returns

A string containing a new unique identifier.

Errors

None.

Example
newGuid

"1513bcbe-93d9-437d-8f66-c68714b6e0c3"
		

getUsers method

Returns a JSON array containing a list of users authorized to access the current database.

Parameters

None.

Returns

A JSON object with an array property named “users”. Each array entry contains an object with two properties, “username” and “rights”.

If the current database is an Access .MDB file, only one entry (the current user) will be present. Only SQL Server databases may include multiple users.
Errors

None.

Example
getUsers

{
  "users": [
    {
      "username": "fbar",
      "rights": "administrator"
    }
  ]
}
		

getCoreInfo method

Returns a JSON object containing information about the application environment.

Parameters
instanceid (identifier, required/calculated) The unique identifier of the application instance.
Returns

A JSON object.

The JSON object returned contains quite a bit of information, organized into a series of nested objects. These objects include:

  • environment: information about the operating envrionment
  • contentdb: information about the current content database (including user rights)
  • application: information about the current content database (including user rights)
  • application.selectedlesson: information about the lesson that was selected at the time the application instance was launched
  • activelesson: information about the lesson currently open in the lesson editor (if any)
Errors
400 instanceid parameter is not specified, and cannot be calculated from the issued request.
404 instanceid not found in the table of running applications.
Example
getCoreInfo

{
  "environment": {
    "username": "foo",
    "machinename": "FOO-PC",
    "ipaddress": "192.168.1.120",
    "osname": "Microsoft Windows 10 Pro (64-bit)",
    "osversion": "Microsoft Windows NT 6.2.9200.0"
  },
  "contentdb": {
    "databasetype": "Mdb",
    "title": "Connect Sample",
    "currentuser": "foo",
    "currentmachine": "foo-pc",
    "accessrights": "Administrator",
    "hasadministratorrights": true,
    "hascontenteditrights": true,
    "sessionid": "F39593B3-BAFE-44F1-B23D-E55E33ABDF74",
    "valid": true,
    "supportstalk": true
  },
  "application": {
    "instanceid": "ad0be294-d750-4976-99a7-cb1cc02b7292",
    "applicationid": "076F8D24-5D61-4625-96DC-56061B479237",
    "instancepath": "C:\\Users\\foo\\connect api caller",
    "instanceurl": "http://localhost:63406/ad0be294-d750-4976-99a7-cb1cc02b7292/",
    "applicationpath": "C:\\Users\\foo\\connect api caller",
    "applicationurl": "http://localhost:63406/076F8D24-5D61-4625-96DC-56061B479237/",
    "applicationfile": "api.html",
    "shellid": "2ef535e9-2232-48f2-b572-72f79f704c7c",
    "shellpath": "C:\\Users\\foo\\sample\\shell",
    "selectedlesson": {
      "lessonid": "F61B870D-429B-425F-B004-7084AB502198",
      "exists": true,
...
    }
  },
  "activelesson": {
...
  }
}
		

getApplicationInfo method

Returns a JSON object containing information about the running application.

Parameters
instanceid (identifier, required/calculated) The unique identifier of the application instance.
Returns

A JSON object.

The information returned in JSON object contains the same information as the application object returned as part of the getCoreInfo method.
Errors
400 instanceid parameter is not specified, and cannot be calculated from the issued request.
404 instanceid not found in the table of running applications.
Example
getApplicationInfo
  {
    "instanceid": "ad0be294-d750-4976-99a7-cb1cc02b7292",
    "applicationid": "076F8D24-5D61-4625-96DC-56061B479237",
    "instancepath": "C:\\Users\\foo\\connect api caller",
    "instanceurl": "http://localhost:63406/ad0be294-d750-4976-99a7-cb1cc02b7292/",
    "applicationpath": "C:\\Users\\foo\\connect api caller",
    "applicationurl": "http://localhost:63406/076F8D24-5D61-4625-96DC-56061B479237/",
    "applicationfile": "api.html",
    "shellid": "2ef535e9-2232-48f2-b572-72f79f704c7c",
    "shellpath": "C:\\Users\\foo\\sample\\shell",
...
    "selectedlesson": {
      "lessonid": "F61B870D-429B-425F-B004-7084AB502198",
      "exists": true,
...
    }
...
  }

closeApplication method

Releases server resources associated with an application instance.

Parameters
instanceid (identifier, required/calculated) The unique identifier of the application instance.
Returns

Nothing.

When an application is started, the connect server creates and stores information about the newly started application instance. This is a very small amount of data; and under normal circumstances, the "leak" from not releasing this data when the application is closed will not affect the operating environment.

This method is only required when the application is an HTML-based application launched in a web browser.  For executable applications, the server will automatically invoke this method when the launched process is closed.

Once this method is invoked, any further calls that require an instanceid parameter will fail, since the server will no longer recognise the instance id.
Errors
400 instanceid parameter is not specified, and cannot be calculated from the issued request.
404 instanceid not found in the table of running applications.
Example
closeApplication

""