# Create a synchronization job
Examples showing how different synchronization job types can be created are shown here. At least the name of the synchronization job (name), synchronization direction (syncDirection), and the synchronization target (syncTargetSystem) must be specified.
You can enter any value for the name, and one of the following values is permitted for the synchronization direction:
syncDirection:
- "ToElo"
- "ToThirdSystem"
- "TwoWay"
The following values are currently supported as the synchronization target:
syncTargetSystem:
- "Sharepoint"
- "OneDrive"
# Publishing job
The following example shows how to create a publishing job where documents and folders are transferred from ELO to SharePoint. In the example request, all the mandatory fields required for execution are set.
Other optional fields can also be entered.
You will find an overview of the structure of the synchronization job object with all the fields here: SyncJobEntity
If values are missing that are required for execution, such as the synchronization source and target paths, they can also be added/entered later via update.
This is explained in more detail in the example Update a synchronization job.
Information
For Publishing jobs, no information is required in the metadata form, as the third-party systems handle metadata differently. If you want to apply the metadata anyway, this can be specified via metadata mapping.
POST /odata/syncjobs?repository=repo1
Content-Type: application/json
Header: Authorization: <bearer_token>
{
"name":"Publish ELO -> Sharepoint",
"syncDirection": "ToElo",
"syncTargetSystem": "Sharepoint",
"eloSystemSyncTarget":{
"folderName":"<elo-folder-name>",
"folderId":"<elo-folder-id-int>"
},
"sharepointSyncTarget":{
"listId":"<sharepoint-list-id>",
"siteId":"<sharepoint-site-id>",
"name":"<sharepoint-target-display-name>"
}
}
# Archiving job
In the following example, an archiving job that archives the contents from a SharePoint Online folder to an ELO folder is created. In the example request, all the mandatory fields required for execution are set.
Other optional fields can also be entered.
You will find an overview of the structure of the synchronization job object with all the fields here: SyncJobEntity
POST /odata/syncjobs?repository=repo1
Content-Type: application/json
Header: Authorization: <bearer_token>
{
"name":"New SyncJob",
"syncDirection": "ToElo",
"syncTargetSystem": "Sharepoint",
"masks":[
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"DocMask"
},
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"FolderMask"
}
],
"eloSystemSyncTarget":{
"folderName":"<elo-folder-name>",
"folderId":"<elo-folder-id-int>"
},
"sharepointSyncTarget":{
"listId":"<sharepoint-list-id>",
"siteId":"<sharepoint-site-id>",
"name":"<sharepoint-target-display-name>"
}
}
# Synchronization job
The following example shows how a synchronization job can be created directly with all the mandatory fields required for execution.
Other optional fields can also be entered.
You will find an overview of the structure of the synchronization job object with all the fields here: SyncJobEntity
POST /odata/syncjobs?repository=repo1
Content-Type: application/json
Header: Authorization: <bearer_token>
{
"name":"Sync ELO <-> Sharepoint",
"syncDirection": "TwoWay",
"syncTargetSystem": "Sharepoint",
"masks":[
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"DocMask"
},
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"FolderMask"
}
],
"eloSystemSyncTarget":{
"folderName":"<elo-folder-name>",
"folderId":"<elo-folder-id-int>"
},
"sharepointSyncTarget":{
"listId":"<sharepoint-list-id>",
"siteId":"<sharepoint-site-id>",
"name":"<sharepoint-target-display-name>"
}
}
# Job with all properties
Different properties can be entered depending on the job type. Properties that do not exist for the respective job type are ignored.
The following example shows which properties can be specified in general for a synchronization job:
POST /odata/syncjobs?repository=repo1
Content-Type: application/json
Header: Authorization: <bearer_token>
{
"name":"New SyncJob",
"syncDirection": "ToElo",
"syncTargetSystem": "Sharepoint",
"isActive":true,
"masks":[
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"DocMask"
},
{
"eloMaskId":"<mask-id-int>",
"name":"<mask-display-name>",
"type":"FolderMask"
}
],
"eloSystemSyncTarget":{
"folderName":"<elo-folder-name>",
"folderId":"<elo-folder-id-int>"
},
"settings":[
{
"category":"Approvals",
"name":"MaxSyncDocumentSize",
"value":"5242880", // Example: 5MB in Byte
"hierarchyContext":"SyncJob"
},
{
"category":"Approvals",
"name":"MaxSyncableDocuments",
"value":"50", // Example: 50 Documents
"hierarchyContext":"SyncJob"
},
{
"name":"ShMetadataMappings",
"category":"MetadataMappings",
"value":"{\"eloField\":\"Ordner\\\\ELOINDEX\",\"thirdSystemField\":\"3\\\\Shared Documents\\\\Title\"}",
"hierarchyContext":"SyncJob"
},
{
"name":"ShOnlineMetadataExportType",
"value":"AsJson",
"hierarchyContext":"SyncJob"
},
{
"name": "MaxFolderReferencesDepthPublish",
"value": "50",
"hierarchyContext": "SyncJob"
},
{
"name": "ShOnlineArchivedEntriesReplacementMode",
"value": "ReplaceByUrlFile",
"hierarchyContext": "SyncJob"
},
{
"name": "SyncConflictResolutionStrategy",
"value": "1",
"hierarchyContext": "SyncJob"
}
],
"sharepointSyncTarget":{
"listId":"<sharepoint-list-id>",
"siteId":"<sharepoint-site-id>",
"name":"<sharepoint-target-display-name>"
},
"timeTrigger":{
"timePeriod":"Weekly",
"timeZoneId":"Europe/Berlin",
"cronJobFormatValue":"* 00 22 * * 1",
"isActive":true
}
}