Skip to main content
All CollectionsCustom integrations
Kjarni integration in Journeys
Kjarni integration in Journeys
Helga Kolbrún Magnúsdóttir avatar
Written by Helga Kolbrún Magnúsdóttir
Updated over a week ago

You can create custom integration with Kjarni in Journeys.

For example you can create an employee and add files to that employee:

Go to Settings->Integrations and select "Add new integration" in the top right corner:

Add logo and name and select "Add integration":

Now select "Authenticate" and insert the authentication information you have from Kjarni. This is an example we have for a development environment but you will have another Authentication URL, Client ID and Client secret.

Press "Test" and then you see whether everything is set up correctly.

Let's say you next want to add an action to create a new employee in Kjarni.

Select "Add endpoint"

But the beginning of that URL is our company address for Kjarni.

Insert this example request:

{
"employeeData": {
"EmployeeDetail": {
"Begda": "2020-06-01T00:00:00.000Z",
"Endda": "9999-12-31T23:59:59.997Z"
},
"EmployeeMaster": {
"Email": "testemail@50skills.com",
"EntityNR": "1811921519",
"BirthDate": "1985-06-27T00:00:00.000Z",
"GenderType": "None",
"EmployeeName": "TEST 50skills Journeys"
},
"EmployeeDetailOrg":
{
"Begda": "2020-06-01T00:00:00.000Z",
"Endda": "9999-12-31T23:59:59.997Z",
"EmployeeGroup": "None",
"EmployeeStatus": "None",
"OrgCompanyID": 1
}
}
}

Press "Submit" -- next make sure that the variable types are all correct (see image) and press "Test"

Now you should see this "employee" in Kjarni 🎉

Note that you can also insert more variables when creating the employee, your example request would just need to contain that data based on the Kjarni API documentation that can be found here: https://api-docs.kjarni.is/#0a99839f-83ad-48c9-99d9-d677e26eb285

Inserting a file to Kjarni

If you want to insert a file to Kjarni, you add a new endpoint.

Example request:

{
"Name": "TestFile",
"Extension": ".txt",
"ObjectDocumentType": 2,
"FileSource": "VGVzdA==",
"Entity_ID": 470,
"EntityType": 2
}

EntityType is the owner of the document, usually '2' means that the owner is the employee "Starfsmaður. The Entitype, or Vísir, can be different between companies but often if the owner is "Launamaður" the ID is 7 or 8.

ObjectDocumentType is the type of document (Vísir) you have in Kjarni, the IDs are different between companies but you need to make sure that the ObjectDocumentType and EntityType match.

Entity_ID is the id of the employee. When the owner, or EntityType, is Starfsmaður the Entity_ID is the EmployeeMasterID or "Starfsmannanúmer". When the owner, or EntityType, is Launamaður the Entity_ID is the EmployeeDetailID or "Launamannanúmer".

Every employee in Kjarni has one Starfsmannanúmer and at least one Launamannanúmer, the Launamannanúmer is the Starfsmannanúmer with a 1 at he end. If an employee has more than one job then the last digit of Launamannanúmer increases. Example: employee has a 55 as a Starfsmannanúmer, for the first job the Launamannanúmer is 551, for the second job the launamannanúmer is 552 and so on. Aðallaunamannúmer refers to the main job or the job with the highter employment rate (starfshlutfall).

make sure that the "Type" for FileSource is "File":

Now you can try it out by pressing "Test".


In the Journey, you can use the response from Kjarni-Create Employee to get the Employee_ID and insert it into the add-file action.

Troubleshooting

If you get the error “Aðgangur leyfir ekki að stofna skjal” when trying to upload a file that means your ObjectDocumentType, EntityType and/or Entity_ID don't match. There are access controls for the EntityType (Owners of the files). These IDs (Vísir) are not Kjarni specific but can be different between customers so you need to look at the setup in the Kjarni you are working on.

Did this answer your question?