(privateMessages)
- createTopicPostPM - Creates a new topic, a new post, or a private message
- getUserSentPrivateMessages - Get a list of private messages sent for a user
- listUserPrivateMessages - Get a list of private messages for a user
Creates a new topic, a new post, or a private message
import { SDK } from "@lukehagar/discoursejs";
async function run() {
const sdk = new SDK();
const res = await sdk.privateMessages.createTopicPostPM({
archetype: "private_message",
raw: "<value>",
targetRecipients: "blake,sam",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.CreateTopicPostPMRequestBody | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.CreateTopicPostPMResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get a list of private messages sent for a user
import { SDK } from "@lukehagar/discoursejs";
import { GetUserSentPrivateMessagesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "<value>";
const res = await sdk.privateMessages.getUserSentPrivateMessages(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
username |
string | ✔️ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetUserSentPrivateMessagesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Get a list of private messages for a user
import { SDK } from "@lukehagar/discoursejs";
import { ListUserPrivateMessagesRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "<value>";
const res = await sdk.privateMessages.listUserPrivateMessages(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
username |
string | ✔️ | N/A |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.ListUserPrivateMessagesResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |