# CommentApi

All URIs are relative to *http://localhost:8080/api/v1*

|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**commentsIdPut**](#commentsidput) | **PUT** /comments/{id} | Update comment|
|[**commentsIdRepliesGet**](#commentsidrepliesget) | **GET** /comments/{id}/replies | Get comment replies|
|[**tracksIdCommentsCommentIdDelete**](#tracksidcommentscommentiddelete) | **DELETE** /tracks/{id}/comments/{comment_id} | Delete comment|
|[**tracksIdCommentsGet**](#tracksidcommentsget) | **GET** /tracks/{id}/comments | Get track comments|
|[**tracksIdCommentsPost**](#tracksidcommentspost) | **POST** /tracks/{id}/comments | Create comment|

# **commentsIdPut**
> CommentsIdPut200Response commentsIdPut(comment)

Update a comment (only by owner)

### Example

```typescript
import {
    CommentApi,
    Configuration,
    InternalHandlersUpdateCommentRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new CommentApi(configuration);

let id: string; //Comment ID (UUID) (default to undefined)
let comment: InternalHandlersUpdateCommentRequest; //Updated comment content

const { status, data } = await apiInstance.commentsIdPut(
    id,
    comment
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **comment** | **InternalHandlersUpdateCommentRequest**| Updated comment content | |
| **id** | [**string**] | Comment ID (UUID) | defaults to undefined|


### Return type

**CommentsIdPut200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation error |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden - can only edit own comments |  -  |
|**404** | Comment not found |  -  |
|**500** | Internal server error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **commentsIdRepliesGet**
> CommentsIdRepliesGet200Response commentsIdRepliesGet()

Get paginated list of replies to a comment

### Example

```typescript
import {
    CommentApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new CommentApi(configuration);

let id: string; //Parent Comment ID (UUID) (default to undefined)
let page: number; //Page number (optional) (default to 1)
let limit: number; //Items per page (optional) (default to 20)

const { status, data } = await apiInstance.commentsIdRepliesGet(
    id,
    page,
    limit
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Parent Comment ID (UUID) | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **limit** | [**number**] | Items per page | (optional) defaults to 20|


### Return type

**CommentsIdRepliesGet200Response**

### Authorization

No authorization required

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation error |  -  |
|**404** | Parent comment not found |  -  |
|**500** | Internal server error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **tracksIdCommentsCommentIdDelete**
> AnalyticsEventsPost200Response tracksIdCommentsCommentIdDelete()

Delete a comment (only by owner or admin)

### Example

```typescript
import {
    CommentApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new CommentApi(configuration);

let id: string; //Track ID (default to undefined)
let commentId: string; //Comment ID (default to undefined)

const { status, data } = await apiInstance.tracksIdCommentsCommentIdDelete(
    id,
    commentId
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Track ID | defaults to undefined|
| **commentId** | [**string**] | Comment ID | defaults to undefined|


### Return type

**AnalyticsEventsPost200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation error |  -  |
|**401** | Unauthorized |  -  |
|**403** | Forbidden - not comment owner |  -  |
|**404** | Comment not found |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **tracksIdCommentsGet**
> TracksIdCommentsGet200Response tracksIdCommentsGet()

Get paginated list of comments for a track

### Example

```typescript
import {
    CommentApi,
    Configuration
} from './api';

const configuration = new Configuration();
const apiInstance = new CommentApi(configuration);

let id: string; //Track ID (default to undefined)
let page: number; //Page number (optional) (default to 1)
let limit: number; //Items per page (optional) (default to 20)

const { status, data } = await apiInstance.tracksIdCommentsGet(
    id,
    page,
    limit
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**string**] | Track ID | defaults to undefined|
| **page** | [**number**] | Page number | (optional) defaults to 1|
| **limit** | [**number**] | Items per page | (optional) defaults to 20|


### Return type

**TracksIdCommentsGet200Response**

### Authorization

No authorization required

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**200** | OK |  -  |
|**400** | Validation error |  -  |
|**404** | Track not found |  -  |
|**500** | Internal server error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

# **tracksIdCommentsPost**
> CommentsIdPut200Response tracksIdCommentsPost(comment)

Create a new comment on a track. Can be a top-level comment or a reply to another comment (using parent_id).

### Example

```typescript
import {
    CommentApi,
    Configuration,
    InternalHandlersCreateCommentRequest
} from './api';

const configuration = new Configuration();
const apiInstance = new CommentApi(configuration);

let id: string; //Track ID (UUID) (default to undefined)
let comment: InternalHandlersCreateCommentRequest; //Comment data

const { status, data } = await apiInstance.tracksIdCommentsPost(
    id,
    comment
);
```

### Parameters

|Name | Type | Description  | Notes|
|------------- | ------------- | ------------- | -------------|
| **comment** | **InternalHandlersCreateCommentRequest**| Comment data | |
| **id** | [**string**] | Track ID (UUID) | defaults to undefined|


### Return type

**CommentsIdPut200Response**

### Authorization

[BearerAuth](../README.md#BearerAuth)

### HTTP request headers

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


### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**201** | Created |  -  |
|**400** | Validation error |  -  |
|**401** | Unauthorized |  -  |
|**404** | Track not found |  -  |
|**500** | Internal server error |  -  |

[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

