The calendar allows CalendarEvents
to be categorized by Calendars and then assigned to relevant Departments.
Model Definition
Alias
calendarEvent
Relations
Key | Relation | Type | Relation Field(s) |
---|
| | | |
| | | |
| | | |
Computed Properties
hash
- The hashed id
of the CalendarEvent
.
Traits
Interval Syntax
List
Get a list of all CalendarEvents
the current authenticated User is allowed to view.
Definition
GET
/api/calendar-events
Example Request
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/calendar-events', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response Body
[
{
"id": 1,
"user_id": 8,
"calendar_id": 1,
"title": "CalendarEvent-1",
"all_day": 1,
"start": "2020-03-17 00:00:00",
"end": "2020-03-23 00:00:00",
"interval": {
"type": "weekly",
"each_weeks": 1,
"days_in_week": [3]
},
"interval_end": null,
"location": null,
"description": null,
"created_at": "2020-03-05 09:54:26",
"updated_at": "2020-03-05 09:54:26",
"repeat_date": false,
"hash": "0gzevr2xpolgmwlm4nyd86wj",
"color": "#009688",
"user": {
"id": 8,
"role_id": 3,
"username": "jeremy.doe",
"first_name": "Jeremy",
"last_name": "Doe",
"active": 1,
"group_account": 0,
"deleted_at": null,
"blacked_out_at": null,
"full_name": "Jeremy Doe",
"online": 0,
"role": {
"id": 3,
"department_id": 3,
"name": "Usergroup-2",
"department": {
"id": 3,
"name": "Usergroup-2"
}
}
},
"calendar": {
"id": 1,
"name": "Calendar-1",
"color": "#009688"
},
"departments": [
{
"id": 2,
"name": "Usergroup-1"
},
{
"id": 3,
"name": "User-Group-2"
},
{
"id": 4,
"name": "User-Group-3"
}
]
},
{
"id": 2,
"user_id": 8,
"calendar_id": 2,
"title": "CalendarEvent-2",
"all_day": 1,
"start": "2020-03-03 00:00:00",
"end": "2020-03-09 00:00:00",
"interval": null,
"interval_end": null,
"location": null,
"description": null,
"created_at": "2020-03-05 09:53:38",
"updated_at": "2020-03-05 09:53:38",
"repeat_date": false,
"hash": "0p8mweyzxnlzevlrd5vgk47j",
"color": "#CDDC39",
"user": {
"id": 8,
"role_id": 3,
"username": "jeremy.doe",
"first_name": "Jeremy",
"last_name": "Schmidt",
"active": 1,
"group_account": 0,
"deleted_at": null,
"blacked_out_at": null,
"full_name": "Jeremy Doe",
"online": 0,
"role": {
"id": 3,
"department_id": 3,
"name": "UserGroup-2",
"department": {
"id": 3,
"name": "UserGroup-2"
}
}
},
"calendar": {
"id": 2,
"name": "Calendar-2",
"color": "#CDDC39"
},
"departments": [
{
"id": 2,
"name": "Usergroup-1"
},
{
"id": 3,
"name": "Usergroup-2"
}
]
}
]
Show
Show a single CalendarEvent
by id
.
Definition
GET
/api/calendar-events/{id}
Example Request
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/calendar-events/1', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
{
"id": 1,
"user_id": 8,
"calendar_id": 1,
"title": "CalendarEvent-1",
"all_day": 1,
"start": "2020-03-17 00:00:00",
"end": "2020-03-23 00:00:00",
"interval": {
"type": "weekly",
"each_weeks": 1,
"days_in_week": [3]
},
"interval_end": null,
"location": null,
"description": null,
"created_at": "2020-03-05 09:54:26",
"updated_at": "2020-03-05 09:54:26",
"repeat_date": false,
"hash": "0gzevr2xpolgmwlm4nyd86wj",
"color": "#009688",
"user": {
"id": 8,
"role_id": 3,
"username": "jeremy.doe",
"first_name": "Jeremy",
"last_name": "Doe",
"active": 1,
"group_account": 0,
"deleted_at": null,
"blacked_out_at": null,
"full_name": "Jeremy Doe",
"online": 0,
"role": {
"id": 3,
"department_id": 3,
"name": "Usergroup-2",
"department": {
"id": 3,
"name": "Usergroup-2"
}
}
},
"calendar": {
"id": 1,
"name": "Calendar-1",
"color": "#009688"
},
"departments": [
{
"id": 2,
"name": "Usergroup-1"
},
{
"id": 3,
"name": "User-Group-2"
},
{
"id": 4,
"name": "User-Group-3"
}
]
}
Create
Create a new CalendarEvent
.
Definition
POST
/api/calendar-events
Request Keys
Keys with *
are required.
Advanced Key-Specifications
interval
- The syntax for intervals can be found here.
interval_end
- The syntax for intervals can be found here.
Example Request
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/calendar-events', [
'headers' => ['Authorization' => "Bearer {accessToken}"],
'json' => [
'user_id' => 3,
'calendar_id' => 1,
'department_ids' => '2,3',
'title' => 'CalendarEvent-1',
'all_day' => true,
'start' => '2020-01-06 00:00:00',
'end' => '2020-02-06 00:00:00',
'interval' => 'w:::1',
'interval_end' => 'r:::10',
'location' => '',
'description' => ''
]
]);
Example Response Body
{
"status": "success",
"data": {
"user_id": "8",
"calendar_id": "1",
"title": "CalendarEvent-1",
"all_day": "1",
"start": "2020-01-06 00:00:00",
"end": "2020-02-06 00:00:00",
"interval": {
"type": "weekly",
"each_weeks": 1
},
"interval_end": {
"type": "repeats",
"repeats": 3
},
"updated_at": "2020-06-05 17:31:06",
"created_at": "2020-06-05 17:31:06",
"id": 1,
"hash": "6o8m0kz5yw10xx1pr9e4vxj2",
"color": "#2196F3",
"departments": [
{
"id": 2,
"name": "UserGroup-1",
"created_at": "2018-09-11 12:47:02",
"updated_at": "2018-09-11 12:47:02",
"deleted_at": null
},
{
"id": 3,
"name": "UserGroup-2",
"created_at": "2018-09-11 12:47:08",
"updated_at": "2018-09-11 12:47:08",
"deleted_at": null
}
],
"user": {
"id": 8,
"username": "jeremy.doe",
"first_name": "Jeremy",
"last_name": "Doe",
"active": 1,
"group_account": 1,
"role_id": 2,
"profile_picture": "/assets/images/profile-pictures/profile-picture-group-account-default.png",
"street": null,
"zipcode": null,
"city": null,
"email": null,
"phone": null,
"birthdate": null,
"gender": null,
"entering_date": null,
"leaving_date": null,
"staff_number": null,
"wants_email_notifications": 0,
"created_at": "2018-09-11 13:47:07",
"updated_at": "2019-04-26 16:04:02",
"password_updated_at": "2019-04-26 16:04:02",
"deactivated_at": null,
"deleted_at": null,
"blacked_out_at": null,
"default_route": "",
"full_name": " ",
"online": 0
},
"calendar": {
"id": 1,
"name": "Calendar-1",
"color": "#2196F3",
"sort_number": 1,
"created_at": "2018-09-11 00:00:00",
"updated_at": "2018-09-13 19:15:15"
}
}
}
Update
Update an existing CalendarEvent
by id
.
Definition
PUT
/api/calendar-event/{id}
Request Keys
Advanced Key-Specifications
interval
- The syntax for intervals can be found here.
interval_end
- The syntax for intervals can be found here.
Example Request
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('PUT', '/api/calendar-events/3', [
'headers' => ['Authorization' => "Bearer {accessToken}"],
'json' => [
'description' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit',
'interval_end' => 'r:::5'
]
]);
Example Response
{
"status": "success",
"data": {
"id": 1,
"user_id": 8,
"calendar_id": 1,
"title": "CalendarEvent-1",
"all_day": 1,
"start": "2020-01-06 00:00:00",
"end": "2020-02-06 00:00:00",
"interval": {
"type": "weekly",
"each_weeks": 1
},
"interval_end": {
"type": "repeats",
"repeats": 5
},
"location": null,
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"created_at": "2020-06-05 17:31:06",
"updated_at": "2020-06-05 17:31:06",
"hash": "6o8m0kz5yw10xx1pr9e4vxj2",
"color": "#2196F3",
"calendar": {
"id": 1,
"name": "Calendar-1",
"color": "#2196F3",
"sort_number": 1,
"created_at": "2018-09-11 00:00:00",
"updated_at": "2018-09-13 19:15:15"
}
}
}
Delete
Delete an existing CalendarEvent
by id
.
Definition
DELETE
/api/calendar-events/{id}
Example Request
$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('DELETE', '/api/calendar-events/3', [
'headers' => ['Authorization' => "Bearer {accessToken}"]
]);
Example Response
{
"status": "success",
"data": []
}