Skip to main content
POST
/
talent-training
/
api
/
v2
/
realized-trainings
Create a realized-training (v2)
curl --request POST \
  --url https://{host}/talent-training/api/v2/realized-trainings \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ownerId": 416,
  "trainingId": 45,
  "sessionStartsOn": "2025-01-04",
  "sessionEndsOn": "2025-01-04",
  "hasAttended": true,
  "durationInHours": 14
}
'
import requests

url = "https://{host}/talent-training/api/v2/realized-trainings"

payload = {
"ownerId": 416,
"trainingId": 45,
"sessionStartsOn": "2025-01-04",
"sessionEndsOn": "2025-01-04",
"hasAttended": True,
"durationInHours": 14
}
headers = {
"Authorization": "<authorization>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: '<authorization>', 'Content-Type': 'application/json'},
body: JSON.stringify({
ownerId: 416,
trainingId: 45,
sessionStartsOn: '2025-01-04',
sessionEndsOn: '2025-01-04',
hasAttended: true,
durationInHours: 14
})
};

fetch('https://{host}/talent-training/api/v2/realized-trainings', 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://{host}/talent-training/api/v2/realized-trainings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'ownerId' => 416,
'trainingId' => 45,
'sessionStartsOn' => '2025-01-04',
'sessionEndsOn' => '2025-01-04',
'hasAttended' => true,
'durationInHours' => 14
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://{host}/talent-training/api/v2/realized-trainings"

payload := strings.NewReader("{\n \"ownerId\": 416,\n \"trainingId\": 45,\n \"sessionStartsOn\": \"2025-01-04\",\n \"sessionEndsOn\": \"2025-01-04\",\n \"hasAttended\": true,\n \"durationInHours\": 14\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://{host}/talent-training/api/v2/realized-trainings")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"ownerId\": 416,\n \"trainingId\": 45,\n \"sessionStartsOn\": \"2025-01-04\",\n \"sessionEndsOn\": \"2025-01-04\",\n \"hasAttended\": true,\n \"durationInHours\": 14\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/talent-training/api/v2/realized-trainings")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"ownerId\": 416,\n \"trainingId\": 45,\n \"sessionStartsOn\": \"2025-01-04\",\n \"sessionEndsOn\": \"2025-01-04\",\n \"hasAttended\": true,\n \"durationInHours\": 14\n}"

response = http.request(request)
puts response.read_body
{
  "id": 235,
  "ownerId": 416,
  "trainingId": 45,
  "sessionStartsOn": "2025-01-04",
  "sessionEndsOn": "2025-01-04",
  "hasAttended": true,
  "durationInHours": 14
}

Headers

Authorization
string
required

API key. Value must be formatted like so: lucca application={api_key}.

Body

application/json

A realized-training represents a completed training process for a given employee.

ownerId
integer<int32>
required

ID of the employee who realized said training.

Required range: x >= 1
sessionStartsOn
string<date>
required

Date of the first day of the training session.

sessionEndsOn
string<date>
required

Date of the last day (included) of the training session.

durationInHours
number<decimal>
required

Duration of the training in hours (e.g. "2.5" means two and a half hours).

Must be a multiple of 0.01

Response

201 - application/json

Created

A realized-training represents a completed training process for a given employee.

ownerId
integer<int32>
required

ID of the employee who realized said training.

Required range: x >= 1
sessionStartsOn
string<date>
required

Date of the first day of the training session.

sessionEndsOn
string<date>
required

Date of the last day (included) of the training session.

durationInHours
number<decimal>
required

Duration of the training in hours (e.g. "2.5" means two and a half hours).

Must be a multiple of 0.01
id
number
read-only
Required range: x >= 1
training
object
read-only
trainingDemandId
integer<int32>
read-only

Reference of the training-demand that led to the registration to this training session.

Required range: x >= 1
sessionId
integer<int32>
read-only

Reference of the training session the employee was registered on.

Required range: x >= 1
hasAttended
boolean
default:true
read-only

Whether the employee actually attended the training or not. You may not create a new realized-training with hasAttended: false, but you may retrieve existing ones in a GET request.