OCS Out-of-office API

The OCS Out-of-office API allows you to access and modify out-of-office data of users.

The base URL for all calls to the Out-of-Office API is: <nextcloud_base_url>/ocs/v2.php/apps/dav/api/v1/outOfOffice

All calls to OCS endpoints require the OCS-APIRequest header to be set to true.

Fetch ongoing data

Fetch data of the ongoing out-of-office period of a user.

field

type

Description

id

string

Database ID of the absence data entity

userId

string

ID of the user which the data belongs to

startDate

int

Timestamp of the start date (respecting the userId's timezone)

endDate

int

Timestamp of the end date (respecting the userId's timezone)

shortMessage

string

Short text that is set as user status during the absence

message

string

Longer multiline message that is shown to others during the absence

replacementUserId

string/null

ID of the replacement user

replacementUserDisplayName

string/null

Displayname of the replacement user

Fetch upcoming or ongoing data

The returned out-of-office period might not have started yet. This endpoint will return data of the ongoing or next upcoming out-of-office period of a user.

field

type

Description

id

int

Database ID of the absence data entity

userId

string

ID of the user which the data belongs to

firstDay

string

First day of the absence in format YYYY-MM-DD

lastDay

string

Last day of the absence in format YYYY-MM-DD

status

string

Short text that is set as user status during the absence

message

string

Longer multiline message that is shown to others during the absence

replacementUserId

string/null

ID of the replacement user

replacementUserDisplayName

string/null

Displayname of the replacement user

Modify out-of-office data

It is only possible to modify out-of-office data of the currently logged in user.

field

type

Description

firstDay

string

First day of the absence in format YYYY-MM-DD

lastDay

string

Last day of the absence in format YYYY-MM-DD

status

string

Short text that is set as user status during the absence

message

string

Longer multiline message that is shown to others during the absence

replacementUserId

string/null

ID of the replacement user

replacementUserDisplayName

string/null

Displayname of the replacement user

field

type

Description

id

int

Database ID of the absence data entity

userId

string

ID of the user which the data belongs to

firstDay

string

First day of the absence in format YYYY-MM-DD

lastDay

string

Last day of the absence in format YYYY-MM-DD

status

string

Short text that is set as user status during the absence

message

string

Longer multiline message that is shown to others during the absence

replacementUserId

string/null

ID of the replacement user

replacementUserDisplayName

string/null

Displayname of the replacement user

Clear data and disable out-of-office

It is only possible to clear out-of-office data of the currently logged in user.