Getting Started: Sjerlok Case API

The Sjerlok Case Management (API) allows users to automatically generate and edit cases at Legentic. This article describes how to get started.

Getting Started

The Legentic Sjerlok Case Management (API) is a direct connection to Legentic Sjerlok tool. It allows you to automatically generate or edit cases that will be then executed and worked on by Legentic. 

Note:

The Legentic Sjerlok Case Management API is part of the Sjerlok tool and requires an active subscription. The API is only available for the category "vehicle" (so luxury watches, musical instruments, machineries, boats, etc. are currently not supported).

First things first

In order to get started, you will need an API key. Contact the team at support@legentic.com and we can set this up for you if you have a Sjerlok subscription. We will need to first fix some paperwork and a signed document that the proper use rules are adhered to. 

The API key you receive should look something like this:

<YOUR_API_KEY> = 7d681e2716a13f2ff******************

The main purpose of the API is to generate or edit the case data.

Get the latest documentation

The latest yaml documentation file can be received from support@legentic.com

Visualise the documentation

Use a tool of choice to visualize the documentation file.

We suggest importing the documentation file you just downloaded in the Swagger Editor, a free online tool, which can be found here: Swagger Editor.

Your test query

You can test the API on our acceptance environment. Simply adjust the url from admin.sjerlok.com/case/vehicles into acc.sjerlok.com/case/vehicles.

Next, you can add the mandatory fields into the test query, which are disappear_date, case_number, object_data, make, and (vin OR license_plate). 

curl 
-X POST
--header "Authorization:Token <token>"
--header "Content-Type: application/json"
--data '<payload in JSON format>'
https://<sjerlok-server>/api/case/vehicles/

Which can be given a payload, such as:

{
"case_number": "12345",
"category": "cars",
"disappear_date": "2017-07-05",
"disappear_zip_code": "123",
"disappear_country": "Romania",
"disappear_city": "Bucharest",
"theft_report_number": "123",
"case_note": "Lost object!",
"object_owner": {
"phone_number": "+31612341234",
"email": "owner.email@emailhost.com",
"name": "Owner Name"
},
"object_data": {
"vin": "WAH000000000000000",
"license_plate": "XY12ABC",
"make": "BMW",
"model": "X1",
"production_date": "2017-08-08",
"first_registration_date": "2017-08-09"
}
}

If all is correct, then you should receive a 200 response.

You are now ready to continue your journey into automatically generating and editing cases in Sjerlok.

Other remarks

We provide API keys for customers and testing. There is no limit on volumes. 

We suggest you start with reading how to integrate in an automated fashion by generating cases first.