Create or update working time
curl --request POST \
--url https://api.projectcor.com/v1/working-time \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": 11111,
"companyId": 11111,
"workingTimes": [
{
"dayOfWeek": "1",
"start": "09:00",
"end": "18:00",
"breakTime": "0"
},
{
"dayOfWeek": "2",
"start": "09:00",
"end": "18:00",
"breakTime": "1"
}
]
}
'import requests
url = "https://api.projectcor.com/v1/working-time"
payload = {
"userId": 11111,
"companyId": 11111,
"workingTimes": [
{
"dayOfWeek": "1",
"start": "09:00",
"end": "18:00",
"breakTime": "0"
},
{
"dayOfWeek": "2",
"start": "09:00",
"end": "18:00",
"breakTime": "1"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 11111,
companyId: 11111,
workingTimes: [
{dayOfWeek: '1', start: '09:00', end: '18:00', breakTime: '0'},
{dayOfWeek: '2', start: '09:00', end: '18:00', breakTime: '1'}
]
})
};
fetch('https://api.projectcor.com/v1/working-time', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/working-time';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 11111,
companyId: 11111,
workingTimes: [
{dayOfWeek: '1', start: '09:00', end: '18:00', breakTime: '0'},
{dayOfWeek: '2', start: '09:00', end: '18:00', breakTime: '1'}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/working-time",
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([
'userId' => 11111,
'companyId' => 11111,
'workingTimes' => [
[
'dayOfWeek' => '1',
'start' => '09:00',
'end' => '18:00',
'breakTime' => '0'
],
[
'dayOfWeek' => '2',
'start' => '09:00',
'end' => '18:00',
'breakTime' => '1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.projectcor.com/v1/working-time"
payload := strings.NewReader("{\n \"userId\": 11111,\n \"companyId\": 11111,\n \"workingTimes\": [\n {\n \"dayOfWeek\": \"1\",\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"breakTime\": \"0\"\n },\n {\n \"dayOfWeek\": \"2\",\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"breakTime\": \"1\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}Working Time
Create or update working time
Creates or updates the user’s working time schedule.
Fields:
dayOfWeek— Day of the week (1 = Sunday, 7 = Saturday)start— Start time in HH:MM format (24-hour clock)end— End time in HH:MM format (24-hour clock)breakTime— Break duration in hours. Valid values: 0, 0.25, 0.5, 0.75, 1, 1.5, 2
POST
/
working-time
Create or update working time
curl --request POST \
--url https://api.projectcor.com/v1/working-time \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"userId": 11111,
"companyId": 11111,
"workingTimes": [
{
"dayOfWeek": "1",
"start": "09:00",
"end": "18:00",
"breakTime": "0"
},
{
"dayOfWeek": "2",
"start": "09:00",
"end": "18:00",
"breakTime": "1"
}
]
}
'import requests
url = "https://api.projectcor.com/v1/working-time"
payload = {
"userId": 11111,
"companyId": 11111,
"workingTimes": [
{
"dayOfWeek": "1",
"start": "09:00",
"end": "18:00",
"breakTime": "0"
},
{
"dayOfWeek": "2",
"start": "09:00",
"end": "18:00",
"breakTime": "1"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 11111,
companyId: 11111,
workingTimes: [
{dayOfWeek: '1', start: '09:00', end: '18:00', breakTime: '0'},
{dayOfWeek: '2', start: '09:00', end: '18:00', breakTime: '1'}
]
})
};
fetch('https://api.projectcor.com/v1/working-time', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/working-time';
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
userId: 11111,
companyId: 11111,
workingTimes: [
{dayOfWeek: '1', start: '09:00', end: '18:00', breakTime: '0'},
{dayOfWeek: '2', start: '09:00', end: '18:00', breakTime: '1'}
]
})
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.projectcor.com/v1/working-time",
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([
'userId' => 11111,
'companyId' => 11111,
'workingTimes' => [
[
'dayOfWeek' => '1',
'start' => '09:00',
'end' => '18:00',
'breakTime' => '0'
],
[
'dayOfWeek' => '2',
'start' => '09:00',
'end' => '18:00',
'breakTime' => '1'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://api.projectcor.com/v1/working-time"
payload := strings.NewReader("{\n \"userId\": 11111,\n \"companyId\": 11111,\n \"workingTimes\": [\n {\n \"dayOfWeek\": \"1\",\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"breakTime\": \"0\"\n },\n {\n \"dayOfWeek\": \"2\",\n \"start\": \"09:00\",\n \"end\": \"18:00\",\n \"breakTime\": \"1\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
200
Working time saved successfully
Was this page helpful?
⌘I

