chatkitty
Version:
OpenAPI client for chatkitty
252 lines (172 loc) • 8.5 kB
Markdown
# ThreadsApi
All URIs are relative to *https://api.chatkitty.com*
|Method | HTTP request | Description|
|------------- | ------------- | -------------|
|[**listThreadMessages**](#listthreadmessages) | **GET** /threads/{id}/messages | List reply thread messages|
|[**retrieveThread**](#retrievethread) | **GET** /threads/{id} | Retrieve a thread|
|[**sendThreadKeystrokes**](#sendthreadkeystrokes) | **POST** /threads/{id}/keystrokes | Send thread keystrokes|
|[**sendThreadMessage**](#sendthreadmessage) | **POST** /threads/{id}/messages | Send a reply thread message|
# **listThreadMessages**
> CursorPagedModelMessageResource listThreadMessages()
Returns a page of replies sent in this thread
### Example
```typescript
import {
ThreadsApi,
Configuration
} from 'chatkitty';
const configuration = new Configuration();
const apiInstance = new ThreadsApi(configuration);
let id: number; // (default to undefined)
let size: number; //The size of the page to be returned (optional) (default to undefined)
let start: number; //Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages (optional) (default to undefined)
let next: number; //Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages (optional) (default to undefined)
let relation: 'SELF' | 'PREVIOUS' | 'NEXT'; //Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages (optional) (default to undefined)
const { status, data } = await apiInstance.listThreadMessages(
id,
size,
start,
next,
relation
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**number**] | | defaults to undefined|
| **size** | [**number**] | The size of the page to be returned | (optional) defaults to undefined|
| **start** | [**number**] | Start cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages | (optional) defaults to undefined|
| **next** | [**number**] | Next page cursor value. Do not set manually. Provided by the Platform API pagination engine to fetch subsequent pages | (optional) defaults to undefined|
| **relation** | [**'SELF' | 'PREVIOUS' | 'NEXT'**]**Array<'SELF' | 'PREVIOUS' | 'NEXT'>** | Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages | (optional) defaults to undefined|
### Return type
**CursorPagedModelMessageResource**
### Authorization
[application_authorization](../README.md#application_authorization)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/vnd.chatkitty+json, application/vnd.chatkitty.v1+json, application/vnd.hal+json, application/hal+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**404** | Resource not found | - |
|**403** | Access is denied | - |
|**400** | Client error | - |
|**401** | Unauthorized: Full authentication is required to access this resource | - |
|**200** | OK | - |
[[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)
# **retrieveThread**
> ReplyThreadResource retrieveThread()
Returns a thread by ID
### Example
```typescript
import {
ThreadsApi,
Configuration
} from 'chatkitty';
const configuration = new Configuration();
const apiInstance = new ThreadsApi(configuration);
let id: number; //Reply thread ID (default to undefined)
const { status, data } = await apiInstance.retrieveThread(
id
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **id** | [**number**] | Reply thread ID | defaults to undefined|
### Return type
**ReplyThreadResource**
### Authorization
[application_authorization](../README.md#application_authorization)
### HTTP request headers
- **Content-Type**: Not defined
- **Accept**: application/json, application/vnd.chatkitty+json, application/vnd.chatkitty.v1+json, application/vnd.hal+json, application/hal+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**404** | Resource not found | - |
|**403** | Access is denied | - |
|**400** | Client error | - |
|**401** | Unauthorized: Full authentication is required to access this resource | - |
|**200** | OK | - |
[[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)
# **sendThreadKeystrokes**
> ReplyThreadKeystrokesResource sendThreadKeystrokes(createDelegatedReplyThreadKeystrokesResource)
Sends keystrokes in this thread on behalf of a user
### Example
```typescript
import {
ThreadsApi,
Configuration,
CreateDelegatedReplyThreadKeystrokesResource
} from 'chatkitty';
const configuration = new Configuration();
const apiInstance = new ThreadsApi(configuration);
let id: number; // (default to undefined)
let createDelegatedReplyThreadKeystrokesResource: CreateDelegatedReplyThreadKeystrokesResource; //
const { status, data } = await apiInstance.sendThreadKeystrokes(
id,
createDelegatedReplyThreadKeystrokesResource
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **createDelegatedReplyThreadKeystrokesResource** | **CreateDelegatedReplyThreadKeystrokesResource**| | |
| **id** | [**number**] | | defaults to undefined|
### Return type
**ReplyThreadKeystrokesResource**
### Authorization
[application_authorization](../README.md#application_authorization)
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json, application/vnd.chatkitty+json, application/vnd.chatkitty.v1+json, application/vnd.hal+json, application/hal+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**404** | Resource not found | - |
|**403** | Access is denied | - |
|**400** | Client error | - |
|**401** | Unauthorized: Full authentication is required to access this resource | - |
|**200** | OK | - |
[[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)
# **sendThreadMessage**
> MessageResource sendThreadMessage(createMessageResource)
Sends a reply message in this thread as the system or on behalf of a user
### Example
```typescript
import {
ThreadsApi,
Configuration,
CreateMessageResource
} from 'chatkitty';
const configuration = new Configuration();
const apiInstance = new ThreadsApi(configuration);
let id: number; // (default to undefined)
let createMessageResource: CreateMessageResource; //
const { status, data } = await apiInstance.sendThreadMessage(
id,
createMessageResource
);
```
### Parameters
|Name | Type | Description | Notes|
|------------- | ------------- | ------------- | -------------|
| **createMessageResource** | **CreateMessageResource**| | |
| **id** | [**number**] | | defaults to undefined|
### Return type
**MessageResource**
### Authorization
[application_authorization](../README.md#application_authorization)
### HTTP request headers
- **Content-Type**: application/json, multipart/form-data
- **Accept**: application/json, application/vnd.chatkitty+json, application/vnd.chatkitty.v1+json, application/vnd.hal+json, application/hal+json
### HTTP response details
| Status code | Description | Response headers |
|-------------|-------------|------------------|
|**404** | Resource not found | - |
|**403** | Access is denied | - |
|**400** | Client error | - |
|**401** | Unauthorized: Full authentication is required to access this resource | - |
|**200** | OK | - |
[[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)