# CollaborativeCalendarApi.EventsApi

All URIs are relative to *http://localhost:8000*

Method | HTTP request | Description
------------- | ------------- | -------------
[**addEvent**](EventsApi.md#addEvent) | **POST** /events | Add a new event
[**eventsEventIdDelete**](EventsApi.md#eventsEventIdDelete) | **DELETE** /events/{eventId} | Deletes an existing event
[**getEvents**](EventsApi.md#getEvents) | **GET** /events | Get all events
[**updateEvent**](EventsApi.md#updateEvent) | **PUT** /events/{eventId} | Updates an existing event

<a name="addEvent"></a>
# **addEvent**
> Event addEvent(name, _date, startingtime, endingtime, opts)

Add a new event

Add a new event

### Example
```javascript
import {CollaborativeCalendarApi} from 'collaborative_calendar_api';

let apiInstance = new CollaborativeCalendarApi.EventsApi();
let name = "name_example"; // String | Name of the event
let _date = new Date("2013-10-20T19:20:30+01:00"); // Date | Date of the event
let startingtime = "startingtime_example"; // String | Startingtime of the event
let endingtime = "endingtime_example"; // String | Endingtime of the event
let opts = { 
  'body': new CollaborativeCalendarApi.Event(), // Event | Add a new event to the calendar
  'dailyevent': true, // Boolean | The event takes a whole day
  'description': "description_example" // String | Description of the event
};
apiInstance.addEvent(name, _date, startingtime, endingtime, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **name** | **String**| Name of the event | 
 **_date** | **Date**| Date of the event | 
 **startingtime** | **String**| Startingtime of the event | 
 **endingtime** | **String**| Endingtime of the event | 
 **body** | [**Event**](Event.md)| Add a new event to the calendar | [optional] 
 **dailyevent** | **Boolean**| The event takes a whole day | [optional] 
 **description** | **String**| Description of the event | [optional] 

### Return type

[**Event**](Event.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

<a name="eventsEventIdDelete"></a>
# **eventsEventIdDelete**
> eventsEventIdDelete(eventId)

Deletes an existing event

### Example
```javascript
import {CollaborativeCalendarApi} from 'collaborative_calendar_api';

let apiInstance = new CollaborativeCalendarApi.EventsApi();
let eventId = 789; // Number | Event Id of the event to delete

apiInstance.eventsEventIdDelete(eventId, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **eventId** | **Number**| Event Id of the event to delete | 

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="getEvents"></a>
# **getEvents**
> getEvents()

Get all events

Get all events

### Example
```javascript
import {CollaborativeCalendarApi} from 'collaborative_calendar_api';

let apiInstance = new CollaborativeCalendarApi.EventsApi();
apiInstance.getEvents((error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
});
```

### Parameters
This endpoint does not need any parameter.

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: Not defined
 - **Accept**: Not defined

<a name="updateEvent"></a>
# **updateEvent**
> Event updateEvent(eventId, name, _date, startingtime, endingtime, opts)

Updates an existing event

Updates an existing event

### Example
```javascript
import {CollaborativeCalendarApi} from 'collaborative_calendar_api';

let apiInstance = new CollaborativeCalendarApi.EventsApi();
let eventId = 789; // Number | Event Id of the event to delete
let name = "name_example"; // String | Name of the event
let _date = new Date("2013-10-20T19:20:30+01:00"); // Date | Date of the event
let startingtime = "startingtime_example"; // String | Startingtime of the event
let endingtime = "endingtime_example"; // String | Endingtime of the event
let opts = { 
  'body': new CollaborativeCalendarApi.Event(), // Event | Add a new event to the calendar
  'dailyevent': true, // Boolean | The event takes a whole day
  'description': "description_example" // String | Description of the event
};
apiInstance.updateEvent(eventId, name, _date, startingtime, endingtime, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **eventId** | **Number**| Event Id of the event to delete | 
 **name** | **String**| Name of the event | 
 **_date** | **Date**| Date of the event | 
 **startingtime** | **String**| Startingtime of the event | 
 **endingtime** | **String**| Endingtime of the event | 
 **body** | [**Event**](Event.md)| Add a new event to the calendar | [optional] 
 **dailyevent** | **Boolean**| The event takes a whole day | [optional] 
 **description** | **String**| Description of the event | [optional] 

### Return type

[**Event**](Event.md)

### Authorization

No authorization required

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: application/json

