mirror of
https://github.com/LukeHagar/discoursejs.git
synced 2025-12-06 12:27:48 +00:00
13 KiB
13 KiB
Invites
(invites)
Available Operations
- createInvite - Create an invite
- inviteToTopic - Invite to topic
createInvite
Create an invite
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.invites.createInvite("<value>", "<value>", {
email: "not-a-user-yet@example.com",
groupIds: "42,43",
groupNames: "foo,bar",
maxRedemptionsAllowed: 5,
});
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
requestBody |
operations.CreateInviteRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.CreateInviteResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
inviteToTopic
Invite to topic
Example Usage
import { SDK } from "@lukehagar/discoursejs";
const sdk = new SDK();
async function run() {
const result = await sdk.invites.inviteToTopic("<value>", "<value>", "<value>");
// Handle the result
console.log(result)
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey |
string | ✔️ | N/A |
apiUsername |
string | ✔️ | N/A |
id |
string | ✔️ | N/A |
requestBody |
operations.InviteToTopicRequestBody | ➖ | N/A |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Response
Promise<operations.InviteToTopicResponseBody>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |