# Export calendar events in iCalendar format

`GET /discourse-post-event/events.ics`

Authentication: no security requirement declared for this operation.

Parameters:

- `category_id` (query, integer, optional) - Filter events by category ID
  Type: integer

- `include_subcategories` (query, string, optional) - Include events from subcategories when filtering by category
  Type: string
  
  enum: ["true","false"]

- `attending_user` (query, string, optional) - Filter to events where the specified user (username) has RSVP'd
as going
  Type: string

- `before` (query, string, date-time, optional) - Return events starting before this date/time (ISO 8601 format)
  Type: string, date-time

- `after` (query, string, date-time, optional) - Return events starting after this date/time (ISO 8601 format)
  Type: string, date-time

- `order` (query, string, optional) - Sort order for events by start date (default: asc)
  Type: string
  
  enum: ["asc","desc"]

- `limit` (query, integer, optional) - Maximum number of events to return (default: 200)
  Type: integer
  
  minimum: 1
  
  maximum: 200

Responses:

- 200: iCalendar file

Content type: text/calendar

Type: string, binary

## Examples

### cURL

```bash
curl -X GET 'https://discourse.example.com/discourse-post-event/events.ics'
```

### JavaScript

```javascript
const response = await fetch('https://discourse.example.com/discourse-post-event/events.ics', {
  method: 'GET',
});

const data = await response.text();
```

### Python

```python
import requests

response = requests.get('https://discourse.example.com/discourse-post-event/events.ics')
print(response.text)
```
