Class: PrivateMessageService
services/private_message.PrivateMessageService
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
constructor
• new PrivateMessageService(): PrivateMessageService
Returns
Methods
chunkUploadDone
▸ chunkUploadDone(data
, config?
): Promise
<SCPrivateMessageUploadMediaType
>
Parameters
Name | Type |
---|---|
data | MessageChunkUploadDoneParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageUploadMediaType
>
Defined in
services/private_message/index.ts:224
deleteAMessage
▸ deleteAMessage(id
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/private_message/index.ts:209
deleteAThread
▸ deleteAThread(params
, config?
): Promise
<any
>
Parameters
Name | Type |
---|---|
params | ThreadDeleteParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<any
>
Defined in
services/private_message/index.ts:212
getASingleMessage
▸ getASingleMessage(id
, config?
): Promise
<SCPrivateMessageThreadType
>
Parameters
Name | Type |
---|---|
id | string | number |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageThreadType
>
Defined in
services/private_message/index.ts:203
getAThread
▸ getAThread(params
, config?
): Promise
<SCPaginatedResponse
<SCPrivateMessageThreadType
>>
Parameters
Name | Type |
---|---|
params | ThreadParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCPrivateMessageThreadType
>>
Defined in
services/private_message/index.ts:200
getAllSnippets
▸ getAllSnippets(config?
): Promise
<SCPaginatedResponse
<SCPrivateMessageSnippetType
>>
Parameters
Name | Type |
---|---|
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCPrivateMessageSnippetType
>>
Defined in
services/private_message/index.ts:197
searchUser
▸ searchUser(search
, config?
): Promise
<SCPaginatedResponse
<SCUserType
>>
Parameters
Name | Type |
---|---|
search | string |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPaginatedResponse
<SCUserType
>>
Defined in
services/private_message/index.ts:227
sendAMessage
▸ sendAMessage(data
, config?
): Promise
<SCPrivateMessageThreadType
>
Parameters
Name | Type |
---|---|
data | MessageCreateParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageThreadType
>
Defined in
services/private_message/index.ts:206
uploadMedia
▸ uploadMedia(data
, config?
): Promise
<SCPrivateMessageUploadMediaType
>
Parameters
Name | Type |
---|---|
data | MessageMediaUploadParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageUploadMediaType
>
Defined in
services/private_message/index.ts:215
uploadMediaInChunks
▸ uploadMediaInChunks(data
, config?
): Promise
<SCPrivateMessageUploadMediaChunkType
>
Parameters
Name | Type |
---|---|
data | MessageMediaChunksParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageUploadMediaChunkType
>
Defined in
services/private_message/index.ts:221
uploadThumbnail
▸ uploadThumbnail(data
, config?
): Promise
<SCPrivateMessageUploadThumbnailType
>
Parameters
Name | Type |
---|---|
data | MessageThumbnailUploadParams |
config? | AxiosRequestConfig <any > |
Returns
Promise
<SCPrivateMessageUploadThumbnailType
>