Get a specific historical version of a worker.
curl --request GET \
--url https://{workspace}.klef.ai/api/workers/{id}/history/{version} \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/workers/{id}/history/{version}"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/workers/{id}/history/{version}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{workspace}.klef.ai/api/workers/{id}/history/{version}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{workspace}.klef.ai/api/workers/{id}/history/{version}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/workers/{id}/history/{version}")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/workers/{id}/history/{version}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": {
"id": "<string>",
"employeeId": "<string>",
"legalName": {
"givenName": "<string>",
"familyName": "<string>"
},
"preferredName": {
"givenName": "<string>",
"familyName": "<string>"
},
"name": "<string>",
"email": "<string>",
"businessCommunication": {
"emails": [
{
"address": "<string>",
"isPrimary": true
}
],
"phones": [
{
"kind": "mobile",
"number": "<string>",
"extension": "<string>",
"isPrimary": true
}
]
},
"personalCommunication": {
"emails": [
{
"address": "<string>",
"isPrimary": true
}
],
"phones": [
{
"kind": "mobile",
"number": "<string>",
"extension": "<string>",
"isPrimary": true
}
]
},
"profile": {
"preferredLanguage": "<string>",
"timeZone": "<string>",
"photoUrl": "<string>"
},
"workAuthorization": {
"type": "<string>",
"country": "<string>",
"expiresOn": "<string>"
},
"lifecycle": {
"originalHireDate": "<string>",
"seniorityDate": "<string>",
"probationEndDate": "<string>",
"terminationDate": "<string>",
"separationType": "unspecified",
"terminationReason": {
"code": "<string>",
"name": "<string>"
},
"isTransfer": true
},
"leave": {
"isOnLeave": true,
"type": "unspecified",
"startDate": "<string>",
"expectedReturnDate": "<string>"
},
"isContractor": true,
"source": "adp_workforce_now",
"sourceId": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"status": "unspecified",
"lifecycleStage": "pre_start",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"assignments": [
{
"id": "<string>",
"sourceId": "<string>",
"isPrimary": true,
"status": "unspecified",
"workerType": "employee",
"employmentType": "unspecified",
"timeType": "unspecified",
"department": {
"code": "<string>",
"name": "<string>"
},
"costCenter": {
"code": "<string>",
"name": "<string>"
},
"businessUnit": {
"code": "<string>",
"name": "<string>"
},
"job": {
"code": "<string>",
"name": "<string>"
},
"position": {
"code": "<string>",
"name": "<string>"
},
"assignedLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"physicalLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"managerId": "<string>",
"manager": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"organizationUnits": [
{
"isPrimary": true,
"type": "<string>",
"code": "<string>",
"name": "<string>"
}
],
"reporting": {
"manager": {
"id": "<string>",
"name": "<string>",
"jobTitle": "<string>"
},
"unsyncedManager": "<string>",
"teammates": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}
],
"accounts": [
"adp_workforce_now"
],
"version": 123,
"isCurrent": true,
"primaryAssignment": {
"id": "<string>",
"sourceId": "<string>",
"isPrimary": true,
"status": "unspecified",
"workerType": "employee",
"employmentType": "unspecified",
"timeType": "unspecified",
"department": {
"code": "<string>",
"name": "<string>"
},
"costCenter": {
"code": "<string>",
"name": "<string>"
},
"businessUnit": {
"code": "<string>",
"name": "<string>"
},
"job": {
"code": "<string>",
"name": "<string>"
},
"position": {
"code": "<string>",
"name": "<string>"
},
"assignedLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"physicalLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"managerId": "<string>",
"manager": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"organizationUnits": [
{
"isPrimary": true,
"type": "<string>",
"code": "<string>",
"name": "<string>"
}
],
"reporting": {
"manager": {
"id": "<string>",
"name": "<string>",
"jobTitle": "<string>"
},
"unsyncedManager": "<string>",
"teammates": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}
},
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}Workers
Get a specific historical version of a worker.
GET
/
workers
/
{id}
/
history
/
{version}
Get a specific historical version of a worker.
curl --request GET \
--url https://{workspace}.klef.ai/api/workers/{id}/history/{version} \
--cookie klef.session=import requests
url = "https://{workspace}.klef.ai/api/workers/{id}/history/{version}"
headers = {"cookie": "klef.session="}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {cookie: 'klef.session='}};
fetch('https://{workspace}.klef.ai/api/workers/{id}/history/{version}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{workspace}.klef.ai/api/workers/{id}/history/{version}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_COOKIE => "klef.session=",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{workspace}.klef.ai/api/workers/{id}/history/{version}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("cookie", "klef.session=")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{workspace}.klef.ai/api/workers/{id}/history/{version}")
.header("cookie", "klef.session=")
.asString();require 'uri'
require 'net/http'
url = URI("https://{workspace}.klef.ai/api/workers/{id}/history/{version}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["cookie"] = 'klef.session='
response = http.request(request)
puts response.read_body{
"result": {
"id": "<string>",
"employeeId": "<string>",
"legalName": {
"givenName": "<string>",
"familyName": "<string>"
},
"preferredName": {
"givenName": "<string>",
"familyName": "<string>"
},
"name": "<string>",
"email": "<string>",
"businessCommunication": {
"emails": [
{
"address": "<string>",
"isPrimary": true
}
],
"phones": [
{
"kind": "mobile",
"number": "<string>",
"extension": "<string>",
"isPrimary": true
}
]
},
"personalCommunication": {
"emails": [
{
"address": "<string>",
"isPrimary": true
}
],
"phones": [
{
"kind": "mobile",
"number": "<string>",
"extension": "<string>",
"isPrimary": true
}
]
},
"profile": {
"preferredLanguage": "<string>",
"timeZone": "<string>",
"photoUrl": "<string>"
},
"workAuthorization": {
"type": "<string>",
"country": "<string>",
"expiresOn": "<string>"
},
"lifecycle": {
"originalHireDate": "<string>",
"seniorityDate": "<string>",
"probationEndDate": "<string>",
"terminationDate": "<string>",
"separationType": "unspecified",
"terminationReason": {
"code": "<string>",
"name": "<string>"
},
"isTransfer": true
},
"leave": {
"isOnLeave": true,
"type": "unspecified",
"startDate": "<string>",
"expectedReturnDate": "<string>"
},
"isContractor": true,
"source": "adp_workforce_now",
"sourceId": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"status": "unspecified",
"lifecycleStage": "pre_start",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"assignments": [
{
"id": "<string>",
"sourceId": "<string>",
"isPrimary": true,
"status": "unspecified",
"workerType": "employee",
"employmentType": "unspecified",
"timeType": "unspecified",
"department": {
"code": "<string>",
"name": "<string>"
},
"costCenter": {
"code": "<string>",
"name": "<string>"
},
"businessUnit": {
"code": "<string>",
"name": "<string>"
},
"job": {
"code": "<string>",
"name": "<string>"
},
"position": {
"code": "<string>",
"name": "<string>"
},
"assignedLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"physicalLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"managerId": "<string>",
"manager": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"organizationUnits": [
{
"isPrimary": true,
"type": "<string>",
"code": "<string>",
"name": "<string>"
}
],
"reporting": {
"manager": {
"id": "<string>",
"name": "<string>",
"jobTitle": "<string>"
},
"unsyncedManager": "<string>",
"teammates": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}
],
"accounts": [
"adp_workforce_now"
],
"version": 123,
"isCurrent": true,
"primaryAssignment": {
"id": "<string>",
"sourceId": "<string>",
"isPrimary": true,
"status": "unspecified",
"workerType": "employee",
"employmentType": "unspecified",
"timeType": "unspecified",
"department": {
"code": "<string>",
"name": "<string>"
},
"costCenter": {
"code": "<string>",
"name": "<string>"
},
"businessUnit": {
"code": "<string>",
"name": "<string>"
},
"job": {
"code": "<string>",
"name": "<string>"
},
"position": {
"code": "<string>",
"name": "<string>"
},
"assignedLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"physicalLocation": {
"code": "<string>",
"name": "<string>",
"line1": "<string>",
"line2": "<string>",
"city": "<string>",
"region": "<string>",
"postalCode": "<string>",
"country": "<string>"
},
"managerId": "<string>",
"manager": "<string>",
"startDate": "<string>",
"endDate": "<string>",
"customFields": [
{
"code": "<string>",
"name": "<string>",
"kind": "text",
"value": "<unknown>"
}
],
"organizationUnits": [
{
"isPrimary": true,
"type": "<string>",
"code": "<string>",
"name": "<string>"
}
],
"reporting": {
"manager": {
"id": "<string>",
"name": "<string>",
"jobTitle": "<string>"
},
"unsyncedManager": "<string>",
"teammates": [
{
"id": "<string>",
"name": "<string>"
}
]
}
}
},
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}{
"result": "<unknown>",
"errors": [
{
"errorCode": "validation_error",
"errorMessage": "<string>",
"target": "<string>"
}
]
}Authorizations
cookieAuthapiKeyAuth
Cookie-based session. Obtain by completing the /auth/login/{provider} OAuth flow; the /auth/callback response sets the klef.session cookie that subsequent requests send automatically.
Was this page helpful?