Skip to main content
The CData Sync REST API V1 supports the following job management actions: The following sections describe each of these actions.

List All Jobs

The following command returns a list of all jobs within the CData Sync application.
GET http://MyDomain.com:8019/api.rsc/jobs(jobname)
Query Parameter
NameDescription
JobNameName of the job to retrieve.

Create a Job

The following command creates a new job to run in the Sync application:
POST http://MyDomain.com:8019/api.rsc/jobs
Body Parameters
NameDescription
JobNameSpecifies the name of the job.
SourceSpecifies the name of the source connection.
DestinationSpecifies the name of the destination connection.
ScheduledSpecifies whether to execute a job according to a specific scheduler. Set the parameter to True to execute the job per a specific scheduler.
ScheduledCronThe scheduler cron string.
NotifyWindowsEventSpecifies whether to write error messages to the Microsoft Window Application Event log. Set this parameter to True to write error messages to that event log.
SendEmailNotificationSpecifies whether to send email alerts after job completion. Set this parameter to True to send the email alerts.
NotifyEmailToSpecifies the email address to which alerts should be sent.
NotifyEmailSubjectSpecifies the email subject for alerts.
EmailErrorOnlySpecifies to send an email only when an error occurs.
VerbositySpecifies the log verbosity level of the job.
TableNamePrefixSpecifies a prefix for all tables that are replicated.
UseGmtDateTimeSpecifies whether to synchronize times in Greenwich Mean Time (rather than local time). Set this parameter to True to synchronize times in the GMT time zone.
TruncateTableDataSpecifies whether to delete all rows before each update. Set this parameter to True to delete all rows before an update.
DropTableSpecifies whether to drop a table before each update. Set this parameter to True to drop a table before an update.
AutoTruncateStringsSpecifies whether to truncate strings automatically that are too large for the column size. Set this parameter to True to truncate strings automatically if they are too large for the column.
ContinueOnErrorSpecifies whether a job should continue to the next query when it encounters an error. Set this parameter to True for the job to continue to the next table when previous table generates an error.
AlterSchemaSpecifies whether to add columns and alter data types when the source table metadata and the destination table metadata do not match. Set this parameter to True to add columns and alter data types if a mismatch does occur.
ReplicateIntervalPaired with ReplicateIntervalUnit, this parameter controls the time frames in which to split the data during replication.
ReplicateIntervalUnitPaired with ReplicateInterval, this parameter controls the time frames in which to split the data during replication. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDateSets the minimum date (in the form yyyy-MM-dd) from which to begin replicating data.
BatchSizeSets the size of the batch.
CommandTimeoutControls the time-out for destination connections.
SkipDeletedSpecifies whether to skip the retrieval of deleted records from the source.
OtherCacheOptionsSpecifies a comma-separated list of additional options to include.
CacheSchemaAssigns a specific schema for the destination database.
PreJobSpecifies the code of pre-job event.
PostJobSpecifies the code of post-job event.
Query#Specifies an array of SQL statements to include in the job. Specify multiple queries with the syntax Query#1, Query#2, and so on.
TypeSpecifies the type of job. Values are Standard, SyncAll, LoadFolder, ChangeDataCapture, EnhancedChangeDataCapture, ReverseETL.
Example Request
{ 
  "JobName": "MyNewJob", 
  "Source": "SourceConnection",
  "Destination": "DestinationConnection",
  "Query#1":"REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Invoices]"
}

Modify a Job

The following command modifies an existing job:
PUT http://mydomain.com:8019/api.rsc/jobs(jobname)
Note: You cannot modify a job that is running. Query Parameter
NameDescription
JobName (required)Specifies the name of the job to modify.
Body Parameters
NameDescription
ScheduledSpecifies whether to execute a job according to a specific scheduler. Set the parameter to True to execute the job per a specific scheduler.
ScheduledCronThe scheduler cron string.
NotifyWindowsEventSpecifies whether to write error messages to the Microsoft Window Application Event log. Set this parameter to True to write error messages to that event log.
SendEmailNotificationSpecifies whether to send email alerts after job completion. Set this parameter to True to send the email alerts.
NotifyEmailToSpecifies the email address to which alerts should be sent.
NotifyEmailSubjectSpecifies the email subject for alerts.
EmailErrorOnlySpecifies to send an email only when an error occurs.
VerbositySpecifies the log verbosity level of the job. Values are 1, 2, 3, and 5.
TableNamePrefixSpecifies a prefix for all tables that are replicated.
UseGmtDateTimeSpecifies whether to synchronize times in Greenwich Mean Time (rather than local time). Set this parameter to True to synchronize times in the GMT time zone.
TruncateTableDataSpecifies whether to delete all rows before each update. Set this parameter to True to delete all rows before an update.
DropTableSpecifies whether to drop a table before each update. Set this parameter to True to drop a table before an update.
AutoTruncateStringsSpecifies whether to truncate strings automatically that are too large for the column size. Set this parameter to True to truncate strings automatically if they are too large for the column.
ContinueOnErrorSpecifies whether a job should continue to the next query when it encounters an error. Set this parameter to True for the job to continue to the next table when previous table generates an error.
AlterSchemaSpecifies whether to add columns and alter data types when the source table metadata and the destination table metadata do not match. Set this parameter to True to add columns and alter data types if a mismatch does occur.
ReplicateIntervalPaired with ReplicateIntervalUnit, this parameter controls the time frames in which to split the data during replication.
ReplicateIntervalUnitPaired with ReplicateInterval, this parameter controls the time frames in which to split the data during replication. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDateSets the minimum date (in the form yyyy-MM-dd) from which to begin replicating data.
BatchSizeSets the size of the batch.
CommandTimeoutControls the time-out for destination connections.
SkipDeletedSpecifies whether to skip the retrieval of deleted records from the source.
OtherCacheOptionsSpecifies a comm- separated list of additional options to include.
CacheSchemaAssigns a specific schema for the destination database.
PreJobSpecifies the code of pre-job event.
PostJobSpecifies the code of post-job event.
Example Request
{ 
  "Scheduled": "true",
  "ScheduledCron": "0-30/5 * * * *"
}

Delete a Job

The following command removes a job from the Sync application:
DELETE http://MyDomain.com:8019/api.rsc/jobs(jobname)
Note: You cannot delete a job that is running. Query Parameter
NameDescription
JobNameName of the job to delete.

List All Transformations

The following command returns a list of all transformations within the Sync application.
GET http://MyDomain.com:8019/api.rsc/transformations(transformationname)
Query Parameter
NameDescription
TransformationNameName of the transformation to retrieve.

Create a Transformation

The following command creates a new job to run in the Sync application:
POST http://MyDomain.com:8019/api.rsc/transformations
Body Parameters
NameDescription
TransformationNameSpecifies the name of the transformation.
ConnectionSpecifies the name of the destination connection.
TransformationTriggerModeSpecifies whether to run the transformation on a schedule or after a job. Values for this parameter are None (the default value), Scheduled, and After Job.
TriggerAfterJobSpecifies the job after which the transformation will run.
TriggerTasksSpecifies a comma-separated list of task Ids.
ScheduledCronSpecifies the scheduler cron string.
SendEmailNotificationSends email alerts after transformations are complete. Set this to True to send the email alerts.
NotifyEmailToSpecifies the email address to which alerts are to be sent.
NotifyEmailSubjectSpecifies the email subject for alerts.
EmailErrorOnlySpecifies to send an email only when an error occurs.
VerbositySpecifies the log verbosity level of the transformation.
Query#Specifies an array of SQL statements to include in the transformation. Specify multiple queries with the syntax Query#1, Query#2, and so on.
Example Request
{ 
  "TransformationName": "MyNewTransformation", 
  "Connection": "DestinationConnection",
  "Query#1":"CREATE OR REPLACE TABLE dbo.Accounts_Deduplicated as (SELECT *, row_number() over (partition by id order by modified desc) as duplicate_rank FROM dbo.Accounts);",
  "Query#2": "DELETE FROM dbo.Accounts_Deduplicated	WHERE duplicate_rank > 1;"
}

Modify a Transformation

The following command modifies an existing transformation:
PUT http://MyDomain.com:8019/api.rsc/transformations(transformationname)
Note: You cannot modify a transformation that is running. Query Parameter
NameDescription
TransformationName (Required)Specifies the name of the transformation to modify.
Body Parameters
NameDescription
TransformationTriggerModeSpecifies whether to run the transformation on a schedule or after a job. Values for this parameter are None (the default value), Scheduled, and AfterJob.
TriggerAfterJobSpecifies the job after which the transformation will run.
TriggerTasksSpecifies a comma-separated list of task Ids.
ScheduledCronSpecifies the scheduler cron string.
SendEmailNotificationSends email alerts after transformations are complete. Set this to True to send the email alerts.
NotifyEmailToSpecifies the email address to which alerts are to be sent.
NotifyEmailSubjectSpecifies the email subject for alerts.
EmailErrorOnlySpecifies to send an email only when an error occurs.
VerbositySpecifies the log verbosity level of the transformation.
Example Request
{ 
  "TransformationTriggerMode": "Scheduled",
  "ScheduledCron": "0-30/5 * * * *"
}

Delete a Transformation

The following command removes a transformation from the Sync application: You cannot delete a transformation that is running.
DELETE http://MyDomain.com:8019/api.rsc/transformations(transformationname)
Note: You cannot delete a transformation that is running. Query Parameter
NameDescription
TransformationName (Required)Specifies the name of the transformation that you want to delete.

Execute a Job or a Transformation

This command executes the specified job or transformation:
POST http://MyDomain.com:8019/api.rsc/executeJob
Body Parameters
NameDescription
JobName (required)Specifies the name of the job to execute.
WaitForResultsSpecifies whether to wait until the job ends to return results. The default value is True.
TimeoutSpecifies how long to wait, in seconds, for the previous job execution to complete.
Example Request
{
  "JobName": "MyJob",
  "WaitForResults" : true,
  "Timeout": 30
}

Execute Job Queries

The following command executes specific queries within a job.
POST http://MyDomain.com:8019/api.rsc/executeQuery
Note: The queries that you want to execute must be part of the job already. Body Parameters
NameDescription
JobName (required)Specifies the name of the job to execute.
Query# (required)Specifies an array of query statements to execute. Specify multiple queries with the syntax Query#1, Query#2, and so on.
WaitForResultsSpecifies whether to wait until the job ends to return results. The default value is True.
Example Request
{
  "JobName": "MyJob",
  "Query#1": "REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Contacts]"
}

Cancel a Running Job

The following command cancels a job that is running:
POST http://MyDomain.com:8019/api.rsc/cancelJob
Body Parameters
NameDescription
JobName (required)Specifies the name of the job to cancel.
Example Request
{
  "JobName": "MyJob"
}

Retrieve the Job Status

The following command retrieves the status of a job:
POST http://MyDomain.com:8019/api.rsc/getJobStatus
Body Parameters
NameDescription
JobNameSpecifies the name of the job for which to retrieve the status. If a job name is specified, the response contains details for each query that is within the job.
Example Request
{
  "JobName":"MyJob"
}

Retrieve the Job History

The following command retrieves the history of the previous runs for a job:
GET http://MyDomain.com:8019/api.rsc/history
Query Parameter
NameDescription
JobNameSpecifies the name of the job for which to retrieve the history.

Download Job Logs

The following command downloads the base-64-encoded contents of the log file or log files for a job:
POST http://mydomain.com:8019/api.rsc/getLogs
Body Parameters
NameDescription
JobName (required)Specifies the name of the job from which to retrieve logs.
Days (required)Specifies how many days of log files to include.

List All Job Tasks

The following command retrieves a list of tasks that are associated with a job or transformation:
GET http://MyDomain.com:8019/api.rsc/tasks(jobname)
Query Parameter
NameDescription
JobName (required)Specifies the name of the job.

Add a Task to a Job or a Transformation

The following command adds a task to an existing job or transformation:
POST http://MyDomain.com:8019/api.rsc/tasks
Note: You must include either the Query parameter or the Table parameter. Body Parameters
NameDescription
JobName (required)Specifies the name of the job.
QuerySpecifies the query to set as the task.
TableSpecifies the source table to replicate. Sync creates a REPLICATE query from this input.

Update a Task

The following command updates a task in an existing job or transformation:
PUT http://MyDomain.com:8019/api.rsc/tasks
Body Parameters
NameDescription
JobName (required)Specifies the name of the job.
TaskId (required)Specifies the task to update.
QuerySpecifies the query to set as the task.
TableSpecifies the source table to replicate. Sync creates a REPLICATE query from this input.

Delete a Task

The following command deletes a task from an existing job or transformation:
DELETE http://MyDomain.com:8019/api.rsc/tasks
Query Parameters
NameDescription
JobName (required)Specifies the name of the job.
TaskId (required)Specifies the task to delete.