The synchronization service is identified using
syncId, a
resource ID returned by
Sync.connect. While optional, this should generally be specified explicitly. (If there is only one synchronization session active, the resource ID can be calculated implicitly.)
The action returns an object containing the properties:
| Property | Value |
| "syncId" | The resource ID that identifies this synchronization service. |
| "startTime" | The time that the connection to the synchronization service was initiated. |
| "connection" | The synchronization connection string, in JSON format, used for this connection. Sensitive properties defined in the connection string, such as a password, are not returned. |
| "deviceId" | The synchronization service's device ID, which is used as part of data synchronization. |
| "deviceName" | The synchronization service's device name, which is also used as part of data synchronization. |
| "username" | The name of the user who logged into the synchronization service. For Dropbox connections, this is the email address associated with the account. |
| "apiVersion" | An API version number optionally provided by the synchronization service. |
The action throws an exception if any of its arguments are not specified in a valid form or if the synchronization connection ID is not valid.
const syncId = /* retrieved from a call to CS.Sync.connect */;
const syncInfo = CS.Sync.getConnectionInfo({
syncId
});
if (syncInfo.username === "admin") {
throw new Error("You cannot log in as the administrator!");
}