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