UNPKG

chatkitty

Version:
864 lines (594 loc) 27.9 kB
# UsersApi All URIs are relative to *https://api.chatkitty.com* |Method | HTTP request | Description| |------------- | ------------- | -------------| |[**checkUserExists**](#checkuserexists) | **HEAD** /users | Check a user exists| |[**countUserUnreadMessages**](#countuserunreadmessages) | **GET** /users/{id}/messages/unread/count | Counts the number of unread messages for a user| |[**createUser**](#createuser) | **POST** /users | Create a user| |[**deleteUser**](#deleteuser) | **DELETE** /users/{id} | Delete a user| |[**listUserChannels**](#listuserchannels) | **GET** /users/{id}/channels | List a user\&#39;s channels| |[**listUserMessages**](#listusermessages) | **GET** /users/{id}/messages | List a user\&#39;s messages| |[**listUserNotifications**](#listusernotifications) | **GET** /users/{id}/notifications | List a user\&#39;s notifications| |[**listUsers**](#listusers) | **GET** /users | List users| |[**removeUserSecret**](#removeusersecret) | **DELETE** /users/{id}/secrets/{name} | Remove a user secret| |[**retrieveUser**](#retrieveuser) | **GET** /users/{id} | Retrieve a user| |[**retrieveUserSecret**](#retrieveusersecret) | **GET** /users/{id}/secrets/{name} | Retrieve a user secret| |[**setUserSecret**](#setusersecret) | **PUT** /users/{id}/secrets/{name} | Set a user secret| |[**updateUser**](#updateuser) | **PATCH** /users/{id} | Update a user| |[**updateUserDisplayPicture**](#updateuserdisplaypicture) | **POST** /users/{id}/display-picture | Update a user\&#39;s display picture| # **checkUserExists** > object checkUserExists() Checks if a user exists ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let name: string; //Username of the user (default to undefined) const { status, data } = await apiInstance.checkUserExists( name ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **name** | [**string**] | Username of the user | defaults to undefined| ### Return type **object** ### 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** | User does not exist | - | |**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) # **countUserUnreadMessages** > CountResource countUserUnreadMessages() Returns a count of unread messages for this user ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) const { status, data } = await apiInstance.countUserUnreadMessages( id ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| ### Return type **CountResource** ### 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) # **createUser** > ChatUserResource createUser(createPersonChatUserResource) Creates a new user ### Example ```typescript import { UsersApi, Configuration, CreatePersonChatUserResource } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let createPersonChatUserResource: CreatePersonChatUserResource; // const { status, data } = await apiInstance.createUser( createPersonChatUserResource ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **createPersonChatUserResource** | **CreatePersonChatUserResource**| | | ### Return type **ChatUserResource** ### Authorization [application_authorization](../README.md#application_authorization) ### HTTP request headers - **Content-Type**: application/vnd.chatkitty+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) # **deleteUser** > ApplicationResource deleteUser() Delets a user ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) const { status, data } = await apiInstance.deleteUser( id ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| ### Return type **ApplicationResource** ### 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) # **listUserChannels** > PagedModelChannelResource listUserChannels() Returns a page of channels for this user created or joined ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let page: number; //Zero-based page index (0..N) (optional) (default to 0) let size: number; //The size of the page to be returned (optional) (default to 25) let sort: Array<string>; //Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. (optional) (default to undefined) const { status, data } = await apiInstance.listUserChannels( id, page, size, sort ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| | **page** | [**number**] | Zero-based page index (0..N) | (optional) defaults to 0| | **size** | [**number**] | The size of the page to be returned | (optional) defaults to 25| | **sort** | **Array&lt;string&gt;** | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. | (optional) defaults to undefined| ### Return type **PagedModelChannelResource** ### 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) # **listUserMessages** > CursorPagedModelMessageResource listUserMessages() Returns a page of messages for a user ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (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) let unread: boolean; //Filters by returning unread messages (optional) (default to undefined) const { status, data } = await apiInstance.listUserMessages( id, size, start, next, relation, unread ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | 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** | [**&#39;SELF&#39; | &#39;PREVIOUS&#39; | &#39;NEXT&#39;**]**Array<&#39;SELF&#39; &#124; &#39;PREVIOUS&#39; &#124; &#39;NEXT&#39;>** | Page cursor relation. Do not set manually. Provided by the Platform API pagination engine to fetch previous or next pages | (optional) defaults to undefined| | **unread** | [**boolean**] | Filters by returning unread messages | (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.v1+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) # **listUserNotifications** > CursorPagedModelNotificationResource listUserNotifications() Returns a page of notifications received by this user ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (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.listUserNotifications( id, size, start, next, relation ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | 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** | [**&#39;SELF&#39; | &#39;PREVIOUS&#39; | &#39;NEXT&#39;**]**Array<&#39;SELF&#39; &#124; &#39;PREVIOUS&#39; &#124; &#39;NEXT&#39;>** | 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 **CursorPagedModelNotificationResource** ### 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) # **listUsers** > PagedModelChatUserResource listUsers() Returns a page of users belonging to this application ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let page: number; //Zero-based page index (0..N) (optional) (default to 0) let size: number; //The size of the page to be returned (optional) (default to 25) let sort: Array<string>; //Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. (optional) (default to undefined) let name: string; //Filters by username (optional) (default to undefined) let unread: boolean; //Filters by unread (optional) (default to undefined) let properties: string; //Filters by user custom properties (optional) (default to undefined) const { status, data } = await apiInstance.listUsers( page, size, sort, name, unread, properties ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **page** | [**number**] | Zero-based page index (0..N) | (optional) defaults to 0| | **size** | [**number**] | The size of the page to be returned | (optional) defaults to 25| | **sort** | **Array&lt;string&gt;** | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. | (optional) defaults to undefined| | **name** | [**string**] | Filters by username | (optional) defaults to undefined| | **unread** | [**boolean**] | Filters by unread | (optional) defaults to undefined| | **properties** | [**string**] | Filters by user custom properties | (optional) defaults to undefined| ### Return type **PagedModelChatUserResource** ### 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) # **removeUserSecret** > ChatUserResource removeUserSecret() Removes a user secret\'s value ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let name: string; //The secret\'s name (default to undefined) const { status, data } = await apiInstance.removeUserSecret( id, name ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| | **name** | [**string**] | The secret\&#39;s name | defaults to undefined| ### Return type **ChatUserResource** ### 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) # **retrieveUser** > ChatUserResource retrieveUser() Returns a user by ID ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) const { status, data } = await apiInstance.retrieveUser( id ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| ### Return type **ChatUserResource** ### 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) # **retrieveUserSecret** > SecretResource retrieveUserSecret() Returns a user secret ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let name: string; //The secret\'s name (default to undefined) const { status, data } = await apiInstance.retrieveUserSecret( id, name ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **id** | [**number**] | User ID | defaults to undefined| | **name** | [**string**] | The secret\&#39;s name | defaults to undefined| ### Return type **SecretResource** ### 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) # **setUserSecret** > ChatUserResource setUserSecret(secretResource) Sets a user secret\'s value ### Example ```typescript import { UsersApi, Configuration, SecretResource } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let name: string; //The secret\'s name (default to undefined) let secretResource: SecretResource; // const { status, data } = await apiInstance.setUserSecret( id, name, secretResource ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **secretResource** | **SecretResource**| | | | **id** | [**number**] | User ID | defaults to undefined| | **name** | [**string**] | The secret\&#39;s name | defaults to undefined| ### Return type **ChatUserResource** ### Authorization [application_authorization](../README.md#application_authorization) ### HTTP request headers - **Content-Type**: application/vnd.chatkitty+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) # **updateUser** > ChatUserResource updateUser() Updates a user ### Example ```typescript import { UsersApi, Configuration } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let body: object; // (optional) const { status, data } = await apiInstance.updateUser( id, body ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **body** | **object**| | | | **id** | [**number**] | User ID | defaults to undefined| ### Return type **ChatUserResource** ### Authorization [application_authorization](../README.md#application_authorization) ### HTTP request headers - **Content-Type**: application/json+merge-patch - **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) # **updateUserDisplayPicture** > ChatUserResource updateUserDisplayPicture(createExternalFileProperties) Updates a user\'s display picture ### Example ```typescript import { UsersApi, Configuration, CreateExternalFileProperties } from 'chatkitty'; const configuration = new Configuration(); const apiInstance = new UsersApi(configuration); let id: number; //User ID (default to undefined) let createExternalFileProperties: CreateExternalFileProperties; // const { status, data } = await apiInstance.updateUserDisplayPicture( id, createExternalFileProperties ); ``` ### Parameters |Name | Type | Description | Notes| |------------- | ------------- | ------------- | -------------| | **createExternalFileProperties** | **CreateExternalFileProperties**| | | | **id** | [**number**] | User ID | defaults to undefined| ### Return type **ChatUserResource** ### 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)