Skip to main content

PrivateMessageService

Private Message service can be used in the following way:
1. Import the service from our library:

import {PrivateMessageService} from "@selfcommunity/api-services";
2. Create a function and put the service inside it!
The async function `getAllSnippets` will return the paginated list of snippets.

async getAllSnippets() {
return await PrivateMessageService.getAllSnippets();
}
In case of required `params`, just add them inside the brackets.

async getASingleMessage(messageId) {
return await PrivateMessageService.getASingleMessage(messageId);
}
If you need to customize the request, you can add optional config params (`AxiosRequestConfig` type).

1. Declare it(or declare them, it is possible to add multiple params)

const headers = headers: {Authorization: `Bearer ${yourToken}`}

2. Add it inside the brackets and pass it to the function, as shown in the previous example!

Constructors

new PrivateMessageService()

new PrivateMessageService(): PrivateMessageService

Returns

PrivateMessageService

Methods

chunkUploadDone()

static chunkUploadDone(data, config?): Promise<SCPrivateMessageUploadMediaType>

Parameters

ParameterType
dataMessageChunkUploadDoneParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageUploadMediaType>

Source

services/private_message/index.ts:224


deleteAMessage()

static deleteAMessage(id, config?): Promise<any>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/private_message/index.ts:209


deleteAThread()

static deleteAThread(params, config?): Promise<any>

Parameters

ParameterType
paramsThreadDeleteParams
config?AxiosRequestConfig<any>

Returns

Promise<any>

Source

services/private_message/index.ts:212


getASingleMessage()

static getASingleMessage(id, config?): Promise<SCPrivateMessageThreadType>

Parameters

ParameterType
idstring | number
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageThreadType>

Source

services/private_message/index.ts:203


getAThread()

static getAThread(params, config?): Promise <SCPaginatedResponse<SCPrivateMessageThreadType>>

Parameters

ParameterType
paramsThreadParams
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCPrivateMessageThreadType>>

Source

services/private_message/index.ts:200


getAllSnippets()

static getAllSnippets(config?): Promise <SCPaginatedResponse<SCPrivateMessageSnippetType>>

Parameters

ParameterType
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCPrivateMessageSnippetType>>

Source

services/private_message/index.ts:197


searchUser()

static searchUser(search, config?): Promise <SCPaginatedResponse<SCUserType>>

Parameters

ParameterType
searchstring
config?AxiosRequestConfig<any>

Returns

Promise <SCPaginatedResponse<SCUserType>>

Source

services/private_message/index.ts:227


sendAMessage()

static sendAMessage(data, config?): Promise<SCPrivateMessageThreadType>

Parameters

ParameterType
dataMessageCreateParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageThreadType>

Source

services/private_message/index.ts:206


uploadMedia()

static uploadMedia(data, config?): Promise<SCPrivateMessageUploadMediaType>

Parameters

ParameterType
dataMessageMediaUploadParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageUploadMediaType>

Source

services/private_message/index.ts:215


uploadMediaInChunks()

static uploadMediaInChunks(data, config?): Promise<SCPrivateMessageUploadMediaChunkType>

Parameters

ParameterType
dataMessageMediaChunksParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageUploadMediaChunkType>

Source

services/private_message/index.ts:221


uploadThumbnail()

static uploadThumbnail(data, config?): Promise<SCPrivateMessageUploadThumbnailType>

Parameters

ParameterType
dataMessageThumbnailUploadParams
config?AxiosRequestConfig<any>

Returns

Promise<SCPrivateMessageUploadThumbnailType>

Source

services/private_message/index.ts:218