Job Management API

Version 22.0.8483


Job Management API


Job Management

The REST API supported the following Job management actions:

List all Jobs

Returns a list of all Jobs within the Sync application.

GET http://mydomain.com:8019/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName Name of the Job to retrieve.

Create a Job

Create a new Job to run in the Sync application.

POST http://mydomain.com:8019/api.rsc/jobs

Body Parameters

Name Description
JobName The name of the job.
Source The name of the Source Connection.
Destination The name of the Destination connection.
Scheduled Set this to true to the job can be executed according to a specific scheduler.
ScheduledCron The scheduler cron string.
NotifyWindowsEvent Set this to true to write error messages to the Windows Application Event Log.
SendEmailNotification Set this to true to send email notifications after jobs are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the job.
TableNamePrefix A prefix for all tables being replicated.
UseGmtDateTime Set this to true to synchronize times in the GMT time zone as opposed to local time.
TruncateTableData Set this to true to delete all rows before each update.
DropTable Set this to true to drop the table before each update.
AutoTruncateStrings Set this to true to automatically truncate strings that are too large for the column size.
ContinueOnError Set this to true to continue onto the next table when previous table throws error.
AlterSchema Set this to true to add columns and alter data types if there is a mismatch between the source table metadata and the destination table metadata.
ReplicateInterval Paired with ReplicateIntervalUnit, ReplicateInterval controls the time frames to split the data into when replicating.
ReplicateIntervalUnit Paired with ReplicateInterval, ReplicateIntervalUnit controls the time frames to split the data into when replicating. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDate This option sets the minimum date to start replicating data from (yyyy-MM-dd).
BatchSize Sets the size of batch.
CommandTimeout Controls the timeout for destination connections.
SkipDeleted Whether or not skip retrieving deleted records from source.
OtherCacheOptions A comma separated list of additional options to include.
CacheSchema Assign a specific schema for the destination database.
PreJob The code of Pre-Job event.
PostJob The code of Post-Job event.
Query# An array of SQL statements to include in the Job.
{ 
  "JobName": "MyNewJob", 
  "Source": "SourceConnection",
  "Destination": "DestinationConnection",
  "Query#1":"REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Invoices]"
}

Modify a Job

Modifies an Existing Job. You are unable to modify a Job that is currently running.

PUT http://mydomain.com:8019/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName (required) The name of the job to modify.

Body Parameters

Name Description
Scheduled Set this to true to the job can be executed according to a specific scheduler.
ScheduledCron The scheduler cron string.
NotifyWindowsEvent Set this to true to write error messages to the Windows Application Event Log.
SendEmailNotification Set this to true to send email notifications after jobs are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the job. Values are 1,2,3,5.
TableNamePrefix A prefix for all tables being replicated.
UseGmtDateTime Set this to true to synchronize times in the GMT time zone as opposed to local time.
TruncateTableData Set this to true to delete all rows before each update.
DropTable Set this to true to drop the table before each update.
AutoTruncateStrings Set this to true to automatically truncate strings that are too large for the column size.
ContinueOnError Set this to true to continue onto the next table when previous table throws error.
AlterSchema Set this to true to add columns and alter data types if there is a mismatch between the source table metadata and the destination table metadata.
ReplicateInterval Paired with ReplicateIntervalUnit, ReplicateInterval controls the time frames to split the data into when replicating.
ReplicateIntervalUnit Paired with ReplicateInterval, ReplicateIntervalUnit controls the time frames to split the data into when replicating. Values are minutes, hours, days, weeks, months, years.
ReplicateStartDate This option sets the minimum date to start replicating data from (yyyy-MM-dd).
BatchSize Sets the size of batch.
CommandTimeout Controls the timeout for destination connections.
SkipDeleted Whether or not skip retrieving deleted records from source.
OtherCacheOptions A comma separated list of additional options to include.
CacheSchema Assign a specific schema for the destination database.
PreJob The code of Pre-Job event.
PostJob The code of Post-Job event.
{ 
  "Scheduled": "true",
  "ScheduledCron": "0-30/5 * * * *"
}

Delete a Job

Remove a Job from the Sync application. You are unable to delete a Job that is currently running.

DELETE http://mydomain.com:8019/api.rsc/jobs(jobname)

Query Parameters

Name Description
JobName Name of the Job to Delete.

List all Transformations

Returns a list of all Transformations within the Sync application.

GET http://mydomain.com:8019/api.rsc/transformations(transformationname)

Query Parameters

Name Description
TransformationName Name of the Transformation to retrieve.

Create a Transformation

Create a new Job to run in the Sync application.

POST http://mydomain.com:8019/api.rsc/transformations

Body Parameters

Name Description
TransformationName The name of the transformation.
Connection The name of the Destination connection.
TransformationTriggerMode Whether to run the transformation on a schedule or after a job. Defaults to None. Values are None, Scheduled, AfterJob
TriggerAfterJob The specified job the transformation will run after.
TriggerTasks A comma separated list of Task Ids.
ScheduledCron The scheduler cron string.
SendEmailNotification Set this to true to send email notifications after transformations are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the transformation.
Query# An array of SQL statements to include in the Transformation.
{ 
  "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

Modifies an Existing Transformation. You are unable to modify a Transformation that is currently running.

PUT http://mydomain.com:8019/api.rsc/transformations(transformationname)

Query Parameters

Name Description
TransformationName (Required) Name of the Transformation to modify.

Body Parameters

Name Description
TransformationTriggerMode Whether to run the transformation on a schedule or after a job. Defaults to None. Values are None, Scheduled, AfterJob
TriggerAfterJob The specified job the transformation will run after.
TriggerTasks A comma separated list of Task Ids.
ScheduledCron The scheduler cron string.
SendEmailNotification Set this to true to send email notifications after transformations are completed.
NotifyEmailTo The email address where notifications will be sent to.
NotifyEmailSubject The email subject for notifications.
EmailErrorOnly Only send an email on error.
Verbosity The log verbosity level of the transformation.
{ 
  "TransformationTriggerMode": "Scheduled",
  "ScheduledCron": "0-30/5 * * * *"
}

Delete a Transformation

Remove a Transformation from the Sync application. You are unable to delete a Transformation that is currently running.

DELETE http://mydomain.com:8019/api.rsc/transformations(transformationname)

Query Parameters

Name Description
TransformationName (Required) Name of the Transformation to Delete.

Execute a Job

Start running the specified Job or Transformation

POST http://mydomain.com:8019/api.rsc/executeJob

Body Parameters

Name Description
JobName (required) The name of the job to execute.
WaitForResults Whether to wait until the Job ends to return results. Defaults to true.
Timeout How long to wait in seconds for the previous Job execution to complete.
{
  "JobName": "MyJob",
  "WaitForResults" : true,
  "Timeout": 30
}

Execute Queries in Job

Start running specific queries within a Job. The Queries must already be part of the Job.

POST http://mydomain.com:8019/api.rsc/executeQuery

Body Parameters

Name Description
JobName (required) The name of the job to execute.
Query# (required) An array of Query statements to execute. Specify multiple queries with the syntax Query#1, Query#2, etc.
WaitForResults Whether to wait until the Job ends to return results. Defaults to true.
{
  "JobName": "MyJob",
  "Query#1": "REPLICATE [Accounts]",
  "Query#2": "REPLICATE [Contacts]"
}

Cancel a Job

Cancel a currently running Job. The Job must already be running.

POST http://mydomain.com:8019/api.rsc/cancelJob

Body Parameters

Name Description
JobName (required) The name of the job to cancel.
{
  "JobName": "MyJob"
}

Retrieve Job Status

Retrieves the status of a Job.

POST http://mydomain.com:8019/api.rsc/getJobStatus

Body Parameters

Name Description
JobName Name of the Job to retrieve the status for. If specified, the response will contain details for each query within a Job.
{
  "JobName":"MyJob"
}

Retrieve History of Job

Retrieve the history of the previous runs for a Job.

GET http://mydomain.com:8019/api.rsc/history

Query Parameters

Name Description
JobName Name of the Job to retrieve the history of.

Download Logs of Job

Download the Base64 encoded contents of the logs file(s) for a job.

POST http://mydomain.com:8019/api.rsc/getLogs

Body Parameters

Name Description
JobName (required) Name of the Job to retrieve logs from.
Days (required) Number of Days worth of Log files to include.

List Tasks

Retrieve a list of tasks associated with a Job or Transformation

GET http://mydomain.com:8019/api.rsc/tasks(jobname)

Query Parameters

Name Description
JobName (required) Name of the Job.

Add a Task

Add a task to an existing Job or Transformation. Either Query or Table is required.

POST http://mydomain.com:8019/api.rsc/tasks

Body Parameters

Name Description
JobName (required) Name of the Job.
Query The query to set as the Task
Table The source table to Replicate. Sync will create a Replicate Query from this input.

Modify a Task

Update a task in an existing Job or Transformation.

PUT http://mydomain.com:8019/api.rsc/tasks

Body Parameters

Name Description
JobName (required) Name of the Job.
TaskId (required) The task to update.
Query The query to set as the Task
Table The source table to Replicate. Sync will create a Replicate Query from this input.

Delete a Task

Delete a task from an existing Job or Transformation.

DELETE http://mydomain.com:8019/api.rsc/tasks

Query Parameters

Name Description
JobName (required) Name of the Job.
TaskId (required) The task to delete.