API: Utilities
General-purpose methods.
General-purpose methods.
Returns the string “ack”. Used for confirming a connection to the server.
None.
The string “ack”.
None.
ack
"ack"
Returns a string containing the current date/time on the server.
None.
A string containing the current date/time on the server.
None.
getDate
"2013-11-27T11:01:51.1687458-05:00"
Returns a string containing a new unique identifier.
None.
A string containing a new unique identifier.
None.
newGuid
"1513bcbe-93d9-437d-8f66-c68714b6e0c3"
Returns a JSON array containing a list of users authorized to access the current database.
None.
A JSON object with an array property named “users”. Each array entry contains an object with two properties, “username” and “rights”.
None.
getUsers
{
"users": [
{
"username": "fbar",
"rights": "administrator"
}
]
}
Returns a JSON object containing information about the application environment.
instanceid |
(identifier, required/calculated) The unique identifier of the application instance. |
A JSON object.
The JSON object returned contains quite a bit of information, organized into a series of nested objects. These objects include:
400 | instanceid parameter is not specified, and
cannot be calculated from the issued request. |
404 | instanceid not found in the table of running
applications. |
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": {
...
}
}
Returns a JSON object containing information about the running application.
instanceid |
(identifier, required/calculated) The unique identifier of the application instance. |
A JSON object.
application
object returned as part of the
getCoreInfo
method.400 | instanceid parameter is not specified, and
cannot be calculated from the issued request. |
404 | instanceid not found in the table of running
applications. |
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,
...
}
...
}
Releases server resources associated with an application instance.
instanceid |
(identifier, required/calculated) The unique identifier of the application instance. |
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.
instanceid
parameter will fail, since the server will no longer
recognise the instance id.400 | instanceid parameter is not specified, and
cannot be calculated from the issued request. |
404 | instanceid not found in the table of running
applications. |
closeApplication
""