Get User Leaves
curl --request GET \
--url https://api.projectcor.com/v1/user/leaves \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.projectcor.com/v1/user/leaves"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.projectcor.com/v1/user/leaves', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/user/leaves';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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/user/leaves",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.projectcor.com/v1/user/leaves"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": 14050,
"user_id": 8555,
"company_id": 2336,
"leave_type_id": 1498,
"start": "2024-10-18T03:00:00.000Z",
"end": "2024-10-18T03:30:00.000Z",
"created_at": "2024-10-21 14:19:01",
"updated_at": "2024-10-21 14:19:23",
"deleted_at": null,
"all_day": false,
"leaveType": {
"id": 1498,
"name": "Custom Leave",
"type_code": "UL1498",
"company_id": 2336,
"created_at": "2024-10-21 14:18:36",
"updated_at": "2024-10-21 14:18:36",
"deleted_at": null,
"icon_name": "Futbol"
}
},
{
"id": 10030,
"user_id": 8555,
"company_id": 2336,
"leave_type_id": 12,
"start": "2024-08-29T13:00:00.000Z",
"end": "2024-08-29T15:00:00.000Z",
"created_at": "2024-08-29 13:44:13",
"updated_at": "2024-08-29 13:44:13",
"deleted_at": null,
"all_day": false,
"leaveType": {
"id": 12,
"name": "flexday",
"type_code": "UL12",
"company_id": null,
"created_at": "2022-09-14 12:09:10",
"updated_at": "2024-07-15 17:16:56",
"deleted_at": null,
"icon_name": "Loveseat"
}
}
]User Leaves
Get User Leaves
Gets user leaves for specified users with pagination support.
GET
/
user
/
leaves
Get User Leaves
curl --request GET \
--url https://api.projectcor.com/v1/user/leaves \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.projectcor.com/v1/user/leaves"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.projectcor.com/v1/user/leaves', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));const url = 'https://api.projectcor.com/v1/user/leaves';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
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/user/leaves",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://api.projectcor.com/v1/user/leaves"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}[
{
"id": 14050,
"user_id": 8555,
"company_id": 2336,
"leave_type_id": 1498,
"start": "2024-10-18T03:00:00.000Z",
"end": "2024-10-18T03:30:00.000Z",
"created_at": "2024-10-21 14:19:01",
"updated_at": "2024-10-21 14:19:23",
"deleted_at": null,
"all_day": false,
"leaveType": {
"id": 1498,
"name": "Custom Leave",
"type_code": "UL1498",
"company_id": 2336,
"created_at": "2024-10-21 14:18:36",
"updated_at": "2024-10-21 14:18:36",
"deleted_at": null,
"icon_name": "Futbol"
}
},
{
"id": 10030,
"user_id": 8555,
"company_id": 2336,
"leave_type_id": 12,
"start": "2024-08-29T13:00:00.000Z",
"end": "2024-08-29T15:00:00.000Z",
"created_at": "2024-08-29 13:44:13",
"updated_at": "2024-08-29 13:44:13",
"deleted_at": null,
"all_day": false,
"leaveType": {
"id": 12,
"name": "flexday",
"type_code": "UL12",
"company_id": null,
"created_at": "2022-09-14 12:09:10",
"updated_at": "2024-07-15 17:16:56",
"deleted_at": null,
"icon_name": "Loveseat"
}
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
User ID to get leaves for
Pagination offset
Number of results per page
Response
200 - application/json
List of leaves with their associated leave types
Was this page helpful?
⌘I

