Documentation Powered by Redocly

# HumHub - Calendar API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub calendar module API reference.

# Authentication

## Bearer

Security Scheme Type | JWT

## BasicAuth

Security Scheme Type | HTTP
HTTP Authorization Scheme | basic

# Calendar

## Find all calendars entries

##### query Parameters

page | string >= 0 The number of page of the result set.
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page.

### Responses

/api/v1/calendar

### Response samples

- 200

Content type
application/json
application/json
application/xml
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 6,
    - "title": "Space event by API",
    - "description": "Space event by API description",
    - "start_datetime": "2019-02-27 00:00:00",
    - "end_datetime": "2019-02-28 23:59:00",
    - "all_day": 1,
    - "participation_mode": 2,
    - "color": "#6fdbe8",
    - "allow_decline": 1,
    - "allow_maybe": 1,
    - "time_zone": "America/Los_Angeles",
    - "participant_info": "",
    - "closed": 0,
    - "max_participants": null,
    - "content":
      {
      - "metadata":
        {
        - "id": 14,
        - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
        - "object_model": "humhub\\modules\\post\\models\\Post",
        - "object_id": 12,
        - "visibility": 1,
        - "archived": true,
        - "pinned": false,
        - "locked_comments": false,
        - "created_by":
          {
          - "id": 14,
          - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
          - "display_name": "John Doe",
          - "url": "http://localhost/p/humhub/master/u/j.doe/"
          },
        - "created_at": "2022-04-13 05:15:43",
        - "url": "http://localhost/p/humhub/master/content/perma?id=109",
        - "contentcontainer_id": 5,
        - "stream_channel": "default"
        },
      - "comments":
        {
        - "total": 55,
        - "latestComments":
          [
          - {
            - "id": 14,
            - "message": "Calvin Klein – Between love and madness lies obsession.",
            - "createdBy":
              {
              - "id": 14,
              - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
              - "display_name": "John Doe",
              - "url": "http://localhost/p/humhub/master/u/j.doe/"
              },
            - "createdAt": "2018-08-09 14:22:03"
            }
          ]
        },
      - "likes":
        {
        - "total": 35
        },
      - "files":
        {
        - "id": 14,
        - "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
        - "mime_type": "text/plain",
        - "size": 14353,
        - "file_name": "image.jpg",
        - "url": "http://localhost/p/humhub/master/file/file/download?guid=bded6dc7-e6f4-417e-a638-b653525529ca"
        },
      - "topics":
        [
        - {
          - "id": 135,
          - "name": "News"
          }
        ]
      }
    }
  ]

}`

## Find all calendar entries by container

##### path Parameters

id required | integer ID of content container

##### query Parameters

topics | string Example: topics=Music,Dancing Coma separated list of topics to filter
page | string >= 0 The number of page of the result set.
limit | string [ 1 .. 50 ] Default: 20 The numbers of items to return per page.

### Responses

/api/v1/calendar/container/{id}

### Response samples

- 200
- 404

Content type
application/json
application/json
application/xml
`
{

- "total": 76,
- "page": 1,
- "pages": 8,
- "links":
  {
  - "self": "{endpoint_path}?page=1&per-page=10",
  - "next": "{endpoint_path}?page=2&per-page=10",
  - "last": "{endpoint_path}?page=8&per-page=10"
  },
- "results":
  [
  - {
    - "id": 6,
    - "title": "Space event by API",
    - "description": "Space event by API description",
    - "start_datetime": "2019-02-27 00:00:00",
    - "end_datetime": "2019-02-28 23:59:00",
    - "all_day": 1,
    - "participation_mode": 2,
    - "color": "#6fdbe8",
    - "allow_decline": 1,
    - "allow_maybe": 1,
    - "time_zone": "America/Los_Angeles",
    - "participant_info": "",
    - "closed": 0,
    - "max_participants": null,
    - "content":
      {
      - "metadata":
        {
        - "id": 14,
        - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
        - "object_model": "humhub\\modules\\post\\models\\Post",
        - "object_id": 12,
        - "visibility": 1,
        - "archived": true,
        - "pinned": false,
        - "locked_comments": false,
        - "created_by":
          {
          - "id": 14,
          - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
          - "display_name": "John Doe",
          - "url": "http://localhost/p/humhub/master/u/j.doe/"
          },
        - "created_at": "2022-04-13 05:15:43",
        - "url": "http://localhost/p/humhub/master/content/perma?id=109",
        - "contentcontainer_id": 5,
        - "stream_channel": "default"
        },
      - "comments":
        {
        - "total": 55,
        - "latestComments":
          [
          - {
            - "id": 14,
            - "message": "Calvin Klein – Between love and madness lies obsession.",
            - "createdBy":
              {
              - "id": 14,
              - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
              - "display_name": "John Doe",
              - "url": "http://localhost/p/humhub/master/u/j.doe/"
              },
            - "createdAt": "2018-08-09 14:22:03"
            }
          ]
        },
      - "likes":
        {
        - "total": 35
        },
      - "files":
        {
        - "id": 14,
        - "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
        - "mime_type": "text/plain",
        - "size": 14353,
        - "file_name": "image.jpg",
        - "url": "http://localhost/p/humhub/master/file/file/download?guid=bded6dc7-e6f4-417e-a638-b653525529ca"
        },
      - "topics":
        [
        - {
          - "id": 135,
          - "name": "News"
          }
        ]
      }
    }
  ]

}`

## Deletes a calendar entries by container

##### path Parameters

id required | integer The id of content container

### Responses

/api/v1/calendar/container/{id}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "code": 200,
- "message": "Records successfully deleted!"

}`

# Calendar entry

## Create new calendar entry

##### path Parameters

id required | integer The id of content container

##### Request Body schema: application/json

Calendar entry information

required | object
required | object
| object (Content)

### Responses

/api/v1/calendar/container/{id}

### Request samples

- Payload

Content type
application/json
`
{

- "CalendarEntry":
  {
  - "title": "Api calendar event",
  - "description": "Api calendar event description",
  - "color": "#6fdbe8",
  - "all_day": 0,
  - "participation_mode": 2,
  - "max_participants": null,
  - "allow_decline": 1,
  - "allow_maybe": 1,
  - "participant_info": ""
  },
- "CalendarEntryForm":
  {
  - "is_public": 1,
  - "start_date": "2019-03-23",
  - "start_time": "10:00",
  - "end_date": "2019-03-25",
  - "end_time": "20:30",
  - "timeZone": "America/Los_Angeles",
  - "forceJoin": 0,
  - "topics":
    [
    - 3
    ]
  },
- "content":
  {
  - "metadata":
    {
    - "visibility": 1,
    - "archived": true,
    - "pinned": false,
    - "locked_comments": false
    },
  - "topics":
    [
    - {
      - "name": "News"
      }
    ]
  }

}`

### Response samples

- 200
- 403
- 404
- 500

Content type
application/json
`
{

- "id": 6,
- "title": "Space event by API",
- "description": "Space event by API description",
- "start_datetime": "2019-02-27 00:00:00",
- "end_datetime": "2019-02-28 23:59:00",
- "all_day": 1,
- "participation_mode": 2,
- "color": "#6fdbe8",
- "allow_decline": 1,
- "allow_maybe": 1,
- "time_zone": "America/Los_Angeles",
- "participant_info": "",
- "closed": 0,
- "max_participants": null,
- "content":
  {
  - "metadata":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "object_model": "humhub\\modules\\post\\models\\Post",
    - "object_id": 12,
    - "visibility": 1,
    - "archived": true,
    - "pinned": false,
    - "locked_comments": false,
    - "created_by":
      {
      - "id": 14,
      - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
      - "display_name": "John Doe",
      - "url": "http://localhost/p/humhub/master/u/j.doe/"
      },
    - "created_at": "2022-04-13 05:15:43",
    - "url": "http://localhost/p/humhub/master/content/perma?id=109",
    - "contentcontainer_id": 5,
    - "stream_channel": "default"
    },
  - "comments":
    {
    - "total": 55,
    - "latestComments":
      [
      - {
        - "id": 14,
        - "message": "Calvin Klein – Between love and madness lies obsession.",
        - "createdBy":
          {
          - "id": 14,
          - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
          - "display_name": "John Doe",
          - "url": "http://localhost/p/humhub/master/u/j.doe/"
          },
        - "createdAt": "2018-08-09 14:22:03"
        }
      ]
    },
  - "likes":
    {
    - "total": 35
    },
  - "files":
    {
    - "id": 14,
    - "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
    - "mime_type": "text/plain",
    - "size": 14353,
    - "file_name": "image.jpg",
    - "url": "http://localhost/p/humhub/master/file/file/download?guid=bded6dc7-e6f4-417e-a638-b653525529ca"
    },
  - "topics":
    [
    - {
      - "id": 135,
      - "name": "News"
      }
    ]
  }

}`

## Get calendar entry by id

##### path Parameters

id required | integer The id of the calendar entry

### Responses

/api/v1/calendar/entry/{id}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "id": 6,
- "title": "Space event by API",
- "description": "Space event by API description",
- "start_datetime": "2019-02-27 00:00:00",
- "end_datetime": "2019-02-28 23:59:00",
- "all_day": 1,
- "participation_mode": 2,
- "color": "#6fdbe8",
- "allow_decline": 1,
- "allow_maybe": 1,
- "time_zone": "America/Los_Angeles",
- "participant_info": "",
- "closed": 0,
- "max_participants": null,
- "content":
  {
  - "metadata":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "object_model": "humhub\\modules\\post\\models\\Post",
    - "object_id": 12,
    - "visibility": 1,
    - "archived": true,
    - "pinned": false,
    - "locked_comments": false,
    - "created_by":
      {
      - "id": 14,
      - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
      - "display_name": "John Doe",
      - "url": "http://localhost/p/humhub/master/u/j.doe/"
      },
    - "created_at": "2022-04-13 05:15:43",
    - "url": "http://localhost/p/humhub/master/content/perma?id=109",
    - "contentcontainer_id": 5,
    - "stream_channel": "default"
    },
  - "comments":
    {
    - "total": 55,
    - "latestComments":
      [
      - {
        - "id": 14,
        - "message": "Calvin Klein – Between love and madness lies obsession.",
        - "createdBy":
          {
          - "id": 14,
          - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
          - "display_name": "John Doe",
          - "url": "http://localhost/p/humhub/master/u/j.doe/"
          },
        - "createdAt": "2018-08-09 14:22:03"
        }
      ]
    },
  - "likes":
    {
    - "total": 35
    },
  - "files":
    {
    - "id": 14,
    - "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
    - "mime_type": "text/plain",
    - "size": 14353,
    - "file_name": "image.jpg",
    - "url": "http://localhost/p/humhub/master/file/file/download?guid=bded6dc7-e6f4-417e-a638-b653525529ca"
    },
  - "topics":
    [
    - {
      - "id": 135,
      - "name": "News"
      }
    ]
  }

}`

## Update calendar entry by id

##### path Parameters

id required | integer The id of the calendar entry

##### Request Body schema: application/json

Calendar entry information

required | object
required | object
| object (Content)

### Responses

/api/v1/calendar/entry/{id}

### Request samples

- Payload

Content type
application/json
`
{

- "CalendarEntry":
  {
  - "title": "Api calendar event",
  - "description": "Api calendar event description",
  - "color": "#6fdbe8",
  - "all_day": 0,
  - "participation_mode": 2,
  - "max_participants": null,
  - "allow_decline": 1,
  - "allow_maybe": 1,
  - "participant_info": ""
  },
- "CalendarEntryForm":
  {
  - "is_public": 1,
  - "start_date": "2019-03-23",
  - "start_time": "10:00",
  - "end_date": "2019-03-25",
  - "end_time": "20:30",
  - "timeZone": "America/Los_Angeles",
  - "forceJoin": 0,
  - "sendUpdateNotification": 0,
  - "topics":
    [
    - 3
    ]
  },
- "content":
  {
  - "metadata":
    {
    - "visibility": 1,
    - "archived": true,
    - "pinned": false,
    - "locked_comments": false
    },
  - "topics":
    [
    - {
      - "name": "News"
      }
    ]
  }

}`

### Response samples

- 200
- 403
- 404
- 500

Content type
application/json
`
{

- "id": 6,
- "title": "Space event by API",
- "description": "Space event by API description",
- "start_datetime": "2019-02-27 00:00:00",
- "end_datetime": "2019-02-28 23:59:00",
- "all_day": 1,
- "participation_mode": 2,
- "color": "#6fdbe8",
- "allow_decline": 1,
- "allow_maybe": 1,
- "time_zone": "America/Los_Angeles",
- "participant_info": "",
- "closed": 0,
- "max_participants": null,
- "content":
  {
  - "metadata":
    {
    - "id": 14,
    - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
    - "object_model": "humhub\\modules\\post\\models\\Post",
    - "object_id": 12,
    - "visibility": 1,
    - "archived": true,
    - "pinned": false,
    - "locked_comments": false,
    - "created_by":
      {
      - "id": 14,
      - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
      - "display_name": "John Doe",
      - "url": "http://localhost/p/humhub/master/u/j.doe/"
      },
    - "created_at": "2022-04-13 05:15:43",
    - "url": "http://localhost/p/humhub/master/content/perma?id=109",
    - "contentcontainer_id": 5,
    - "stream_channel": "default"
    },
  - "comments":
    {
    - "total": 55,
    - "latestComments":
      [
      - {
        - "id": 14,
        - "message": "Calvin Klein – Between love and madness lies obsession.",
        - "createdBy":
          {
          - "id": 14,
          - "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
          - "display_name": "John Doe",
          - "url": "http://localhost/p/humhub/master/u/j.doe/"
          },
        - "createdAt": "2018-08-09 14:22:03"
        }
      ]
    },
  - "likes":
    {
    - "total": 35
    },
  - "files":
    {
    - "id": 14,
    - "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
    - "mime_type": "text/plain",
    - "size": 14353,
    - "file_name": "image.jpg",
    - "url": "http://localhost/p/humhub/master/file/file/download?guid=bded6dc7-e6f4-417e-a638-b653525529ca"
    },
  - "topics":
    [
    - {
      - "id": 135,
      - "name": "News"
      }
    ]
  }

}`

## Delete the calendar entry by id

##### path Parameters

id required | integer The id of calendar entry

### Responses

/api/v1/calendar/entry/{id}

### Response samples

- 200
- 404

Content type
application/json
`
{

- "code": 200,
- "message": "Calendar entry successfully deleted!"

}`

# Calendar entry management

## Attach files to calendar entry

##### path Parameters

id required | integer The id of the calendar entry

##### Request Body schema: multipart/form-data

files required | Array of file[ items ] The files to upload.

### Responses

/api/v1/calendar/entry/{id}/upload-files

### Response samples

- 200
- 400
- 404
- 500

Content type
application/json
`
{

- "code": 200,
- "message": "Files successfully uploaded."

}`

## Remove file from calendar entry

##### path Parameters

id required | integer The id of the calendar entry
fileId required | string The id of file to remove.

### Responses

/api/v1/calendar/entry/{id}remove-file/{fileId}

### Response samples

- 200
- 403
- 404
- 500

Content type
application/json
`
{

- "code": 200,
- "message": "File successfully removed."

}`

# Participants

## Change the user participant

##### path Parameters

id required | integer The id of the calendar entry

##### Request Body schema: application/json

type required | integer <int64> Enum: 0 1 2 3 Participant type: 1 - decline. 2 - maybe. 3 - accept. 0 - remove from participants.

### Responses

/api/v1/calendar/entry/{id}/respond

### Request samples

- Payload

Content type
application/json
`
{

- "type": 3

}`

### Response samples

- 200
- 404

Content type
application/json
`
{

- "code": 200,
- "message": "Participation successfully changed."

}`