Syncing Applications
Before we start, do look at Getting started with Knit and How Syncs Work
Prerequisites
- Take a look at How Syncs Work to get familiar with Syncs
- Knit API Key
- Integration ID for any ATS application whitelisted on Knit that has been successfully validated.
With the Applications Sync, you can sync the Applications Data Models via Knit.
1. Events generated by Application Sync
record.new
When a new application has been created
{
"eventId": "e_123sadasdasda",
"eventType": "record.new",
"eventData": {
"info": {},
"currentStage": {},
"interviews": [],
"rejection": {},
"offers": [],
"attachments": []
},
"syncType": "initial_sync",
"syncDataType": "ats_applications",
"syncJobId": "sj_asda32424",
"syncRunId": "sr_jhhkk80869",
"recordId": "123"
}
record.modified
When an application data has been modified
{
"eventId": "e_123sadasdasda",
"eventType": "record.modified",
"eventData": {
"info": {},
"currentStage": {},
"interviews": [],
"rejection": {},
"offers": [],
"attachments": []
},
"syncType": "delta_sync",
"syncDataType": "ats_applications",
"syncJobId": "sj_asda32424",
"syncRunId": "sr_jhhkk80869",
"recordId": "123"
}
record.deleted
When an application is no longer present in the ATS system
{
"eventId": "ev_jLPn5iJNhvhDBh91xtb8kc",
"eventData": {
"applicationId": "",
"candidateId": "",
"jobId": ""
},
"eventType": "record.deleted",
"syncType": "delta_sync",
"syncDataType": "ats_applications",
"syncJobId": "sj_asda32424",
"syncRunId": "sr_jhhkk80869",
"recordId": "123"
}
sync.events.processed
{
"eventId": "ev_UFrXyD8d5yneJ6UnfxAoJ7",
"eventData": {
"status": "processed",
"processed": 200,
"emitted": 0,
"startedAt": "1676292064383",
"processedAt": "1676292068616",
"complete": false
},
"eventType": "sync.events.processed",
"syncType": "delta_sync",
"syncDataType": "ats_applications",
"syncJobId": "sj_rJWQawZYVS8IqgtXkSJ8BQ",
"syncRunId": "sn_agQO87vjVs6tMe9CEsPkBk"
}
sync.events.allConsumed
{
"eventId": "ev_Z9s8E9mwdwju7dpRcCLh7d",
"eventData": {
"status": "completed",
"processed": 200,
"emitted": 200,
"consumed": 200,
"completedAt": "1676281276296",
"startedAt": "1676281265551",
"processedAt": "1676281275876",
"complete": true
},
"eventType": "sync.events.allConsumed",
"syncType": "initial_sync",
"syncDataType": "ats_applications",
"syncJobId": "sj_rJWQawZYVS8IqgtXkSJ8BQ",
"syncRunId": "sn_NHXHC2Hn6oOaLrCfsaqGOM"
}
The webhook will always receive one application data in one request call.
If you are syncing with some account that has 500 applications, you can expect the webhook to be invoked 500 times with each application data dispatched individually by Knit. All 500 applicationsdata will not be dispatched together on one API call.
2. Start an Applicaiton sync by calling Knit API
You can start a sync by invoking Start a Sync API
Do look at all the Application Data Models and subscribe to the ones that you need.
Use the Model ID in
models
array to subscribe to a data model.
String payload = "{
"models": [
"application_info",
"application_stage",
"application_interviews",
"application_rejection",
"application_offers",
"application_attachments"
],
"frequency": "standard",
"destination": "https://call.me/knithook", //your webhook
"dataType": "ats_applications"
}"
//You should have an Integration ID before this step.
String integrationId = "integration-id-received-from-knit-ui-component";
Request request = new Request.Builder()
.url("https://api.getknit.dev/v1.0/sync.start")
.addHeader("Authorization", "Bearer " + YOUR_KNIT_API_KEY)
.addHeader("X-Knit-Integration-Id", integrationId)
.post(RequestBody.create(JSON, payload))
.build();
Response response = HTTP_CLIENT.newCall(request).execute();
if (!response.isSuccessful()) {
//handle error
}
//store the sync job id for tracking the sync status and runs.
String syncJobId = jsonMapper.readTree(response.body().string()).get("data").get("syncJobId").asText();
Updated over 1 year ago