Data Export
The data export feature exports selected UNIFYConnect data for external use. Exports can be downloaded through the web user interface or written to the service's local file system through the REST API or a scheduled job.
Data Sources
Data sources provide the data to be exported. The data sources that are currently available are:
- Connector entities
- Adapter entities
- Channel projected entities
- Channel pending changes
Web User Interface
Open the operations page for a connector, adapter, or channel and select the relevant data export action:
- Entity Data Export for connector or adapter entities
- Projected Entity Data Export for channel projected entities
- Changes Data Export for channel pending changes
In the export dialog, select CSV or JSON, configure file splitting if required, and choose the CSV separator or JSON formatting option. Select Download Export Data to download the result. When file splitting is enabled, the download is provided as a ZIP archive.
Viewing Available Data Sources
The currently registered data sources can be retrieved through the API or from a scheduled job.
REST API
GET /api/1.0/DataExport/RegisteredDataSourcesScheduled Job
$components.DataExportEngine.RegisteredDataSources();Sample Return Value
RegisteredDataSources() returns a dictionary. Each key contains the data source type and ID, and each value is the data source's display name.
The following is a sample script and subsequent output for the RegisteredDataSources method for an environment with a Users connector, Deferred Users channel, and Users adapter.
$components.DataExportEngine.RegisteredDataSources().GetEnumerator() | ForEach-Object {
[PSCustomObject]@{
DataSourceType = $_.Key.Type
DataSourceId = $_.Key.Id
DataSourceName = $_.Value
}
}[
{
"DataSourceType": "Unify.DataSource.Entity",
"DataSourceId": "371f9e74-e7bd-4b10-be37-7cbb5ddbc17a",
"DataSourceName": "Connector Users Entities"
},
{
"DataSourceType": "Unify.DataSource.EntityDelta",
"DataSourceId": "27cad7d0-7dcf-45d6-a488-655adeccb309",
"DataSourceName": "Channel Deferred Users Pending Deltas"
},
{
"DataSourceType": "Unify.DataSource.Entity",
"DataSourceId": "27cad7d0-7dcf-45d6-a488-655adeccb309",
"DataSourceName": "Channel Deferred Users Projected Entities"
},
{
"DataSourceType": "Unify.DataSource.AdapterEntity",
"DataSourceId": "bbc093d9-6fb4-4432-95bb-b692690f3f02",
"DataSourceName": "Adapter Users Entities"
}
]Data Source Types
The following data source types are built in. Plug-ins and modules may register additional types.
Unify.DataSource.EntityUnify.DataSource.AdapterEntityUnify.DataSource.EntityDelta
Note: Data source types may be unique to the callers that are registering them, so it is always recommended to confirm the type from the RegisteredDataSources API or method before use.
For example, the UNIFYConnect Sync Module may register:
Unify.DataSource.LinkConnectionUnify.DataSource.LockerEntity
Exporting Data
To export data through the API or a scheduled job, call the method for the required format and provide the source type and ID. Use RegisteredDataSources to retrieve these values. These methods write to the file system local to the UNIFYConnect service; they do not download files to the caller.
Local CSV
Exports data to files in the file system local to the UNIFYConnect service in CSV format.
| Parameter | Type | Description |
|---|---|---|
OutputDirectoryPath | string | Required. File system path to a directory where export data files will be created. The directory and any parent directories will be created if they do not already exist. |
FileName | string | Required. Base name for the export data files. This value will have the export timestamp appended to it to differentiate files from different exports. |
DataSourceType | string | Required. The type for the data source to export data from. |
DataSourceId | GUID | Required. The ID of the data source to export. |
ValueSeparator | char | A custom character to use as the value separator in the CSV. Defaults to comma. |
MaxItemsPerFile | int | An upper limit on the number of data items in each file. Additional files are created when the export exceeds this limit. Defaults to 0, which disables file splitting. |
REST API
POST /api/1.0/DataExport/ExportToLocalCsv
Content-Type: application/json
{
"OutputDirectoryPath": "C:\\output",
"FileName": "users",
"DataSourceType": "Unify.DataSource.Entity",
"DataSourceId": "371f9e74-e7bd-4b10-be37-7cbb5ddbc17a",
"ValueSeparator": ",",
"MaxItemsPerFile": 10000
}Scheduled Job
$components.DataExportEngine.ExportToLocalCsv("C:\\output", "users", "Unify.DataSource.Entity", "371f9e74-e7bd-4b10-be37-7cbb5ddbc17a", ",", 11000);Local JSON
Exports data to files in the file system local to the UNIFYConnect service in JSON format.
| Parameter | Type | Description |
|---|---|---|
OutputDirectoryPath | string | Required. File system path to a directory where export data files will be created. The directory and any parent directories will be created if they do not already exist. |
FileName | string | Required. Base name for the export data files. This value will have the export timestamp appended to it to differentiate files from different exports. |
DataSourceType | string | Required. The type for the data source to export data from. |
DataSourceId | GUID | Required. The ID of the data source to export. |
Formatted | bool | Whether output JSON files use indentation and line breaks. Defaults to true. |
MaxItemsPerFile | int | An upper limit on the number of data items in each file. Additional files are created when the export exceeds this limit. Defaults to 0, which disables file splitting. |
REST API
POST /api/1.0/DataExport/ExportToLocalJson
Content-Type: application/json
{
"OutputDirectoryPath": "C:\\output",
"FileName": "users",
"DataSourceType": "Unify.DataSource.Entity",
"DataSourceId": "371f9e74-e7bd-4b10-be37-7cbb5ddbc17a",
"Formatted": true,
"MaxItemsPerFile": 10000
}Scheduled Job
$components.DataExportEngine.ExportToLocalJson("C:\\output", "users", "Unify.DataSource.Entity", "371f9e74-e7bd-4b10-be37-7cbb5ddbc17a", $true, 11000);