Skip to main content
POST
/
schedule
/
api
/
employee-assignments
Assign a Working Time Arrangement to an Employee
curl --request POST \
  --url https://{host}/schedule/api/employee-assignments \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "employeeId": 1,
  "workingTimeArrangementId": 1,
  "startsOn": "2023-12-25"
}
'
import requests

url = "https://{host}/schedule/api/employee-assignments"

payload = {
"employeeId": 1,
"workingTimeArrangementId": 1,
"startsOn": "2023-12-25"
}
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({employeeId: 1, workingTimeArrangementId: 1, startsOn: '2023-12-25'})
};

fetch('https://{host}/schedule/api/employee-assignments', 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}/schedule/api/employee-assignments",
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([
'employeeId' => 1,
'workingTimeArrangementId' => 1,
'startsOn' => '2023-12-25'
]),
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}/schedule/api/employee-assignments"

payload := strings.NewReader("{\n \"employeeId\": 1,\n \"workingTimeArrangementId\": 1,\n \"startsOn\": \"2023-12-25\"\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}/schedule/api/employee-assignments")
.header("Authorization", "<authorization>")
.header("Content-Type", "application/json")
.body("{\n \"employeeId\": 1,\n \"workingTimeArrangementId\": 1,\n \"startsOn\": \"2023-12-25\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://{host}/schedule/api/employee-assignments")

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 \"employeeId\": 1,\n \"workingTimeArrangementId\": 1,\n \"startsOn\": \"2023-12-25\"\n}"

response = http.request(request)
puts response.read_body
{
  "workContractId": 1,
  "startsOn": "2023-12-25",
  "employee": {
    "id": 1,
    "firstName": "<string>",
    "lastName": "<string>",
    "displayName": "<string>",
    "jobQualificationName": "<string>",
    "employeeNumber": "<string>",
    "establishmentId": 1,
    "establishmentName": "<string>",
    "department": {
      "id": 1,
      "name": "<string>"
    }
  },
  "id": 1,
  "workingTimeArrangement": {
    "id": 1,
    "name": "<string>"
  },
  "endsOn": "2023-12-25"
}
{
"type": "<string>",
"title": "<string>",
"detail": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"detail": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"detail": "<string>"
}
{
"type": "<string>",
"title": "<string>",
"detail": "<string>"
}

Headers

Authorization
string
required

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

Body

application/json
employeeId
integer<int32>
required
Required range: x >= 0
workingTimeArrangementId
integer<int32>
required
Required range: x >= 0
startsOn
string<date>
required

Response

OK

workContractId
integer<int32>
required
Required range: x >= 0
startsOn
string<date>
required
employee
WtaEmpoyee · object
required
id
integer<int32>
Required range: x >= 0
workingTimeArrangement
WorkingTimeArrangementLite · object
endsOn
null | string<date>