Skip to content

Latest commit

 

History

History
110 lines (85 loc) · 1.69 KB

File metadata and controls

110 lines (85 loc) · 1.69 KB

User Calendars

Gets a list of all available calendars for a specific user.

URL : /api/v1/calendars/:user_id

Method : GET

Auth required : YES

Params constraints

:user_id -> "[user id as an int]",

URL example

/api/v1/calendars/jdoe

Success Response

Code : 200 OK

Notes: The events, notes, and tasks fields return a count (number) if the component is enabled for the calendar, or null if the component is disabled.

Content examples

{
	"status": "success",
	"data": {
		"user_calendars": [
			{
				"id": 1,
				"uri": "default",
				"displayname": "Default Calendar",
				"events": 0,
				"notes": null,
				"tasks": null
			}
		],
		"shared_calendars": [
			{
				"id": 10,
				"uri": "c2152eb0-ada1-451f-bf33-b4a9571ec92e",
				"displayname": "Default Calendar",
				"events": 0,
				"notes": null,
				"tasks": null
			}
		],
		"subscriptions": []
	},
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Shown when user does not have calendars:

{
	"status": "success",
	"data": {
		"user_calendars": [],
		"shared_calendars": [],
		"subscriptions": []
	},
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Error Response

Condition : If 'X-Davis-API-Token' is not present or mismatched in headers.

Code : 401 UNAUTHORIZED

Content :

{
	"message": "No API token provided",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

or

{
	"message": "Invalid API token",
	"timestamp": "2026-01-23T15:01:33+01:00"
}

Condition : If user is not found.

Code : 404 NOT FOUND

Content :

{
	"status": "error", 
    "message": "User Not Found",
	"timestamp": "2026-01-23T15:01:33+01:00"
}