Skip to content

Latest commit

 

History

History
104 lines (74 loc) · 6.9 KB

README.md

File metadata and controls

104 lines (74 loc) · 6.9 KB

Invites

(invites)

Available Operations

createInvite

Create an invite

Example Usage

import { SDK } from "@lukehagar/discoursejs";
import { CreateInviteRequest, CreateInviteRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations";

async function run() {
  const sdk = new SDK();
const apiKey: string = "<value>";
const apiUsername: string = "<value>";
const requestBody: CreateInviteRequestBody = {
  email: "not-a-user-yet@example.com",
  groupIds: "42,43",
  groupNames: "foo,bar",
  maxRedemptionsAllowed: 5,
};

  const res = await sdk.invites.createInvite(apiKey, apiUsername, requestBody);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
apiKey string ✔️ N/A
apiUsername string ✔️ N/A
requestBody operations.CreateInviteRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.CreateInviteResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

inviteToTopic

Invite to topic

Example Usage

import { SDK } from "@lukehagar/discoursejs";
import { InviteToTopicRequest, InviteToTopicRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations";

async function run() {
  const sdk = new SDK();
const apiKey: string = "<value>";
const apiUsername: string = "<value>";
const id: string = "<value>";
const requestBody: InviteToTopicRequestBody = {};

  const res = await sdk.invites.inviteToTopic(apiKey, apiUsername, id, requestBody);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
apiKey string ✔️ N/A
apiUsername string ✔️ N/A
id string ✔️ N/A
requestBody operations.InviteToTopicRequestBody N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.InviteToTopicResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /