Skip to content

Latest commit

 

History

History
2984 lines (2497 loc) · 199 KB

File metadata and controls

2984 lines (2497 loc) · 199 KB

Lms

Overview

Available Operations

batchUpsertContent

Batch upsert multiple external linking learning objects that redirect users to a provider platform for consumption and progress tracking.

Note: Partial updates are not supported. When updating content, you must provide all the same fields that are required when creating content.

See here for more information about external linking learning objects.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import {
  CreateCategoriesApiModelSchemasValue,
  CreateSkillsApiModelSchemasValue,
  LanguageEnumValue,
  LocalizationModelValue,
} from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.batchUpsertContent({
    lmsBatchUpsertContentRequestDto: {
      items: [
        {
          active: true,
          additionalData: [
            {
              id: "learning_outcomes",
              remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
              value: "This is additional data",
            },
          ],
          categories: [
            {
              id: "16873-IT345",
              language: {
                value: CreateCategoriesApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
              unifiedCustomFields: {
                "my_project_custom_field_1": "REF-1236",
                "my_project_custom_field_2": "some other value",
              },
            },
          ],
          contentUrl: "https://www.youtube.com/watch?v=16873",
          coverUrl: "https://www.googledrive.com/?v=16873",
          createdAt: new Date("2021-07-21T14:00:00.000Z"),
          description: "This video acts as learning content for software engineers.",
          duration: "P3Y6M4DT12H30M5S",
          externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
          languages: [
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
          ],
          localizations: [
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
          ],
          mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
          order: 1,
          skills: [
            {
              id: "16873-IT345",
              language: {
                value: CreateSkillsApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
            },
          ],
          tags: [
            "Sales Techniques",
            "Customer Service",
          ],
          title: "Software Engineer Lv 1",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
          updatedAt: new Date("2021-07-21T14:00:00.000Z"),
        },
        {
          active: true,
          additionalData: [
            {
              id: "learning_outcomes",
              remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
              value: "This is additional data",
            },
          ],
          categories: [
            {
              id: "16873-IT345",
              language: {
                value: CreateCategoriesApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
              unifiedCustomFields: {
                "my_project_custom_field_1": "REF-1236",
                "my_project_custom_field_2": "some other value",
              },
            },
          ],
          contentUrl: "https://www.youtube.com/watch?v=16873",
          coverUrl: "https://www.googledrive.com/?v=16873",
          createdAt: new Date("2021-07-21T14:00:00.000Z"),
          description: "This video acts as learning content for software engineers.",
          duration: "P3Y6M4DT12H30M5S",
          externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
          languages: [
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
          ],
          localizations: [
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
          ],
          mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
          order: 1,
          skills: [
            {
              id: "16873-IT345",
              language: {
                value: CreateSkillsApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
            },
          ],
          tags: [
            "Sales Techniques",
            "Customer Service",
          ],
          title: "Software Engineer Lv 1",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
          updatedAt: new Date("2021-07-21T14:00:00.000Z"),
        },
      ],
    },
    prefer: "heartbeat",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsBatchUpsertContent } from "@stackone/stackone-client-ts/funcs/lmsBatchUpsertContent.js";
import {
  CreateCategoriesApiModelSchemasValue,
  CreateSkillsApiModelSchemasValue,
  LanguageEnumValue,
  LocalizationModelValue,
} from "@stackone/stackone-client-ts/sdk/models/shared";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsBatchUpsertContent(stackOne, {
    lmsBatchUpsertContentRequestDto: {
      items: [
        {
          active: true,
          additionalData: [
            {
              id: "learning_outcomes",
              remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
              value: "This is additional data",
            },
          ],
          categories: [
            {
              id: "16873-IT345",
              language: {
                value: CreateCategoriesApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
              unifiedCustomFields: {
                "my_project_custom_field_1": "REF-1236",
                "my_project_custom_field_2": "some other value",
              },
            },
          ],
          contentUrl: "https://www.youtube.com/watch?v=16873",
          coverUrl: "https://www.googledrive.com/?v=16873",
          createdAt: new Date("2021-07-21T14:00:00.000Z"),
          description: "This video acts as learning content for software engineers.",
          duration: "P3Y6M4DT12H30M5S",
          externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
          languages: [
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
          ],
          localizations: [
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
          ],
          mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
          order: 1,
          skills: [
            {
              id: "16873-IT345",
              language: {
                value: CreateSkillsApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
            },
          ],
          tags: [
            "Sales Techniques",
            "Customer Service",
          ],
          title: "Software Engineer Lv 1",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
          updatedAt: new Date("2021-07-21T14:00:00.000Z"),
        },
        {
          active: true,
          additionalData: [
            {
              id: "learning_outcomes",
              remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
              value: "This is additional data",
            },
          ],
          categories: [
            {
              id: "16873-IT345",
              language: {
                value: CreateCategoriesApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
              unifiedCustomFields: {
                "my_project_custom_field_1": "REF-1236",
                "my_project_custom_field_2": "some other value",
              },
            },
          ],
          contentUrl: "https://www.youtube.com/watch?v=16873",
          coverUrl: "https://www.googledrive.com/?v=16873",
          createdAt: new Date("2021-07-21T14:00:00.000Z"),
          description: "This video acts as learning content for software engineers.",
          duration: "P3Y6M4DT12H30M5S",
          externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
          languages: [
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
            {
              value: LanguageEnumValue.EnGB,
            },
          ],
          localizations: [
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
            {
              description: "This video acts as learning content for software engineers.",
              language: {
                value: LocalizationModelValue.EnGB,
              },
              tags: [
                "Sales Techniques",
                "Customer Service",
              ],
              title: "Software Engineer Lv 1",
            },
          ],
          mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
          order: 1,
          skills: [
            {
              id: "16873-IT345",
              language: {
                value: CreateSkillsApiModelSchemasValue.EnGB,
              },
              name: "Information-Technology",
            },
          ],
          tags: [
            "Sales Techniques",
            "Customer Service",
          ],
          title: "Software Engineer Lv 1",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
          updatedAt: new Date("2021-07-21T14:00:00.000Z"),
        },
      ],
    },
    prefer: "heartbeat",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsBatchUpsertContent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsBatchUpsertContentRequest ✔️ The request object to use for the request.
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.LmsBatchUpsertContentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

createUserAssignment

Create an assignment type learning record for a user.

This is the record linking a user to a learning object.

It can be pending or in progress.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import { LmsCreateAssignmentRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.createUserAssignment({
    lmsCreateAssignmentRequestDto: {
      assignedAt: new Date("2021-07-21T14:00:00.000Z"),
      dueDate: new Date("2021-07-21T14:00:00.000Z"),
      learningObjectExternalReference: "learning-content-123",
      learningObjectId: "e3gd34-23tr21-er234-345er56",
      passthrough: {
        "other_known_names": "John Doe",
      },
      progress: 40,
      status: {
        value: LmsCreateAssignmentRequestDtoValue.InProgress,
      },
    },
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsCreateUserAssignment } from "@stackone/stackone-client-ts/funcs/lmsCreateUserAssignment.js";
import { LmsCreateAssignmentRequestDtoValue } from "@stackone/stackone-client-ts/sdk/models/shared";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsCreateUserAssignment(stackOne, {
    lmsCreateAssignmentRequestDto: {
      assignedAt: new Date("2021-07-21T14:00:00.000Z"),
      dueDate: new Date("2021-07-21T14:00:00.000Z"),
      learningObjectExternalReference: "learning-content-123",
      learningObjectId: "e3gd34-23tr21-er234-345er56",
      passthrough: {
        "other_known_names": "John Doe",
      },
      progress: 40,
      status: {
        value: LmsCreateAssignmentRequestDtoValue.InProgress,
      },
    },
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsCreateUserAssignment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsCreateUserAssignmentRequest ✔️ The request object to use for the request.
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.LmsCreateUserAssignmentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

createUserCompletion

Create a completed learning record for a user.

This is the record of a user completing a learning object.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.createUserCompletion({
    lmsCreateCompletionRequestDto: {
      completedAt: new Date("2021-07-21T14:00:00.000Z"),
      learningObjectExternalReference: "learning-content-123",
      learningObjectId: "e3gd34-23tr21-er234-345er56",
      passthrough: {
        "other_known_names": "John Doe",
      },
      score: {
        percentage: 87,
        rawValue: "87 / 100",
      },
      timeSpent: "PT1H30M45S",
    },
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsCreateUserCompletion } from "@stackone/stackone-client-ts/funcs/lmsCreateUserCompletion.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsCreateUserCompletion(stackOne, {
    lmsCreateCompletionRequestDto: {
      completedAt: new Date("2021-07-21T14:00:00.000Z"),
      learningObjectExternalReference: "learning-content-123",
      learningObjectId: "e3gd34-23tr21-er234-345er56",
      passthrough: {
        "other_known_names": "John Doe",
      },
      score: {
        percentage: 87,
        rawValue: "87 / 100",
      },
      timeSpent: "PT1H30M45S",
    },
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsCreateUserCompletion failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsCreateUserCompletionRequest ✔️ The request object to use for the request.
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.LmsCreateUserCompletionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

deleteUserCompletion

Delete a completion type learning record for a user.

This is a record of a user completing a learning object.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.deleteUserCompletion({
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsDeleteUserCompletion } from "@stackone/stackone-client-ts/funcs/lmsDeleteUserCompletion.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsDeleteUserCompletion(stackOne, {
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsDeleteUserCompletion failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsDeleteUserCompletionRequest ✔️ The request object to use for the request.
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.LmsDeleteUserCompletionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getAssignment

Retrieve an assignment type learning record by its identifier.

This is the record linking a user to a learning object.

It can be pending, in progress, or completed.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getAssignment({
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetAssignment } from "@stackone/stackone-client-ts/funcs/lmsGetAssignment.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetAssignment(stackOne, {
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetAssignment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetAssignmentRequest ✔️ The request object to use for the request.
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.LmsGetAssignmentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getCategory

Get Category

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getCategory({
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,level,language,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetCategory } from "@stackone/stackone-client-ts/funcs/lmsGetCategory.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetCategory(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,level,language,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetCategory failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetCategoryRequest ✔️ The request object to use for the request.
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.LmsGetCategoryResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getCompletion

Retrieve a completed learning record by its identifier. This is the record of a user completing a learning object.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getCompletion({
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetCompletion } from "@stackone/stackone-client-ts/funcs/lmsGetCompletion.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetCompletion(stackOne, {
    prefer: "heartbeat",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetCompletion failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetCompletionRequest ✔️ The request object to use for the request.
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.LmsGetCompletionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getContent

Retrieve a content type learning object by its identifier.

These are the most granular learning objects (e.g. video, document, podcast) on a platform.

Only content objects for which the platform supports progress and completion tracking are returned.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getContent({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags,authors,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetContent } from "@stackone/stackone-client-ts/funcs/lmsGetContent.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetContent(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags,authors,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetContent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetContentRequest ✔️ The request object to use for the request.
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.LmsGetContentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getCourse

Retrieve a course type learning object by its identifier.

These are collections of content type learning objects that are grouped together for a specific learning purpose.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getCourse({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations,authors,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetCourse } from "@stackone/stackone-client-ts/funcs/lmsGetCourse.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetCourse(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations,authors,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetCourse failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetCourseRequest ✔️ The request object to use for the request.
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.LmsGetCourseResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getSkill

Get Skill

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getSkill({
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,language,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetSkill } from "@stackone/stackone-client-ts/funcs/lmsGetSkill.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetSkill(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,language,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetSkill failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetSkillRequest ✔️ The request object to use for the request.
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.LmsGetSkillResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getUser

Get User

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getUser({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetUser } from "@stackone/stackone-client-ts/funcs/lmsGetUser.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetUser(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields",
    id: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetUser failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetUserRequest ✔️ The request object to use for the request.
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.LmsGetUserResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getUserAssignment

Retrieve an assignment type learning record for a user by its identifier.

This is the record linking a user to a learning object.

It can be pending, in progress, or completed.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getUserAssignment({
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetUserAssignment } from "@stackone/stackone-client-ts/funcs/lmsGetUserAssignment.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetUserAssignment(stackOne, {
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetUserAssignment failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetUserAssignmentRequest ✔️ The request object to use for the request.
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.LmsGetUserAssignmentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

getUserCompletion

Retrieve a completed learning record for a user by its identifier.

This is the record of a user completing a learning object.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.getUserCompletion({
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsGetUserCompletion } from "@stackone/stackone-client-ts/funcs/lmsGetUserCompletion.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsGetUserCompletion(stackOne, {
    prefer: "heartbeat",
    id: "<id>",
    subResourceId: "<id>",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsGetUserCompletion failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsGetUserCompletionRequest ✔️ The request object to use for the request.
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.LmsGetUserCompletionResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listAssignments

Retrieve a list of assignment type learning records.

These are the records linking a user to a learning object.

They can be pending, in progress, or completed.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listAssignments({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,user_id,remote_user_id,course_id,remote_course_id,updated_at,created_at,assigned_at,due_date,status,progress,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,certificate_url,result,completed_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    remoteUserId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    userId: "c28xyrc55866bvuv",
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListAssignments } from "@stackone/stackone-client-ts/funcs/lmsListAssignments.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListAssignments(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,user_id,remote_user_id,course_id,remote_course_id,updated_at,created_at,assigned_at,due_date,status,progress,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,certificate_url,result,completed_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    remoteUserId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    userId: "c28xyrc55866bvuv",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListAssignments failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListAssignmentsRequest ✔️ The request object to use for the request.
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.LmsListAssignmentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listCategories

List Categories

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listCategories({
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,level,language,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListCategories } from "@stackone/stackone-client-ts/funcs/lmsListCategories.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListCategories(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,level,language,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListCategories failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListCategoriesRequest ✔️ The request object to use for the request.
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.LmsListCategoriesResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listCompletions

Retrieve a list of completed learning records. These are the records of a user completing learning objects.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listCompletions({
    prefer: "heartbeat",
    fields: "id,remote_id,external_id,remote_external_id,external_reference,content_id,remote_content_id,course_id,remote_course_id,user_id,remote_user_id,completed_at,updated_at,created_at,result,content_external_reference,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,time_spent,certificate_url,score,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListCompletions } from "@stackone/stackone-client-ts/funcs/lmsListCompletions.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListCompletions(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_id,remote_external_id,external_reference,content_id,remote_content_id,course_id,remote_course_id,user_id,remote_user_id,completed_at,updated_at,created_at,result,content_external_reference,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,time_spent,certificate_url,score,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListCompletions failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListCompletionsRequest ✔️ The request object to use for the request.
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.LmsListCompletionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listContent

Retrieve a list of content type learning objects.

These are the most granular learning objects (e.g. video, document, podcast) on a platform.

Only content objects for which the platform supports progress and completion tracking are returned.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listContent({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags,authors,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListContent } from "@stackone/stackone-client-ts/funcs/lmsListContent.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListContent(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,course_ids,remote_course_ids,title,description,additional_data,languages,content_url,mobile_launch_content_url,content_type,cover_url,active,duration,order,categories,skills,updated_at,created_at,provider,localizations,tags,authors,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListContent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListContentRequest ✔️ The request object to use for the request.
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.LmsListContentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listCourses

Retrieve a list of course type learning objects.

These are collections of content type learning objects that are grouped together for a specific learning purpose.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listCourses({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations,authors,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListCourses } from "@stackone/stackone-client-ts/funcs/lmsListCourses.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListCourses(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,content_ids,remote_content_ids,title,description,languages,cover_url,url,active,duration,categories,skills,updated_at,created_at,content,provider,localizations,authors,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListCourses failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListCoursesRequest ✔️ The request object to use for the request.
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.LmsListCoursesResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listSkills

List Skills

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listSkills({
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,language,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListSkills } from "@stackone/stackone-client-ts/funcs/lmsListSkills.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListSkills(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,name,active,hierarchy,language,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListSkills failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListSkillsRequest ✔️ The request object to use for the request.
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.LmsListSkillsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listUserAssignments

Retrieve a list of assignment type learning records for a user.

These are the records linking a user to learning objects.

They can be pending, in progress, or completed.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listUserAssignments({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,user_id,remote_user_id,course_id,remote_course_id,updated_at,created_at,assigned_at,due_date,status,progress,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,certificate_url,result,completed_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    remoteUserId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    userId: "c28xyrc55866bvuv",
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListUserAssignments } from "@stackone/stackone-client-ts/funcs/lmsListUserAssignments.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListUserAssignments(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,user_id,remote_user_id,course_id,remote_course_id,updated_at,created_at,assigned_at,due_date,status,progress,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,certificate_url,result,completed_at,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    remoteUserId: "e3cb75bf-aa84-466e-a6c1-b8322b257a48",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    userId: "c28xyrc55866bvuv",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListUserAssignments failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListUserAssignmentsRequest ✔️ The request object to use for the request.
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.LmsListUserAssignmentsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listUserCompletions

Retrieve a list of completed learning records for a user.

These are the records of a user completing learning objects.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listUserCompletions({
    prefer: "heartbeat",
    fields: "id,remote_id,external_id,remote_external_id,external_reference,content_id,remote_content_id,course_id,remote_course_id,user_id,remote_user_id,completed_at,updated_at,created_at,result,content_external_reference,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,time_spent,certificate_url,score,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListUserCompletions } from "@stackone/stackone-client-ts/funcs/lmsListUserCompletions.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListUserCompletions(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_id,remote_external_id,external_reference,content_id,remote_content_id,course_id,remote_course_id,user_id,remote_user_id,completed_at,updated_at,created_at,result,content_external_reference,learning_object_type,learning_object_id,remote_learning_object_id,learning_object_external_reference,time_spent,certificate_url,score,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    id: "<id>",
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListUserCompletions failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListUserCompletionsRequest ✔️ The request object to use for the request.
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.LmsListUserCompletionsResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

listUsers

List Users

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.listUsers({
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });

  for await (const page of result) {
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsListUsers } from "@stackone/stackone-client-ts/funcs/lmsListUsers.js";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsListUsers(stackOne, {
    prefer: "heartbeat",
    fields: "id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields",
    filter: {
      updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    },
    updatedAfter: new Date("2020-01-01T00:00:00.000Z"),
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    for await (const page of result) {
    console.log(page);
  }
  } else {
    console.log("lmsListUsers failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsListUsersRequest ✔️ The request object to use for the request.
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.LmsListUsersResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*

upsertContent

Create or update an external linking learning object that redirects users to a provider platform for consumption and progress tracking.

Note: Partial updates are not supported. When updating content, you must provide all the same fields that are required when creating content.

See here for more information about external linking learning objects.

Example Usage

import { StackOne } from "@stackone/stackone-client-ts";
import { CreateCategoriesApiModelSchemasValue, LanguageEnumValue } from "@stackone/stackone-client-ts/sdk/models/shared";

const stackOne = new StackOne({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const result = await stackOne.lms.upsertContent({
    lmsUpsertContentRequestDto: {
      active: true,
      additionalData: [
        {
          id: "learning_outcomes",
          remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
          value: "This is additional data",
        },
        {
          id: "learning_outcomes",
          remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
          value: "This is additional data",
        },
      ],
      authors: [
        {
          id: "123",
          name: "John Doe",
        },
      ],
      categories: [
        {
          id: "16873-IT345",
          language: {
            value: CreateCategoriesApiModelSchemasValue.EnGB,
          },
          name: "Information-Technology",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
        },
        {
          id: "16873-IT345",
          language: {
            value: CreateCategoriesApiModelSchemasValue.EnGB,
          },
          name: "Information-Technology",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
        },
      ],
      contentUrl: "https://www.youtube.com/watch?v=16873",
      coverUrl: "https://www.googledrive.com/?v=16873",
      createdAt: new Date("2021-07-21T14:00:00.000Z"),
      description: "This video acts as learning content for software engineers.",
      duration: "P3Y6M4DT12H30M5S",
      externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
      languages: [
        {
          value: LanguageEnumValue.EnGB,
        },
      ],
      localizations: [
        {
          description: "This course acts as learning resource for software engineers.",
          title: "Software Engineer Lv 1",
        },
        {
          description: "This course acts as learning resource for software engineers.",
          title: "Software Engineer: A comprehensive guide",
        },
      ],
      mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
      order: 1,
      passthrough: {
        "other_known_names": "John Doe",
      },
      skills: [
        {
          id: "12345",
          name: "Sales Techniques",
        },
      ],
      tags: [
        "Sales Techniques",
        "Customer Service",
      ],
      title: "Software Engineer Lv 1",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
      updatedAt: new Date("2021-07-21T14:00:00.000Z"),
    },
    prefer: "heartbeat",
    xAccountId: "<id>",
  });

  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { StackOneCore } from "@stackone/stackone-client-ts/core.js";
import { lmsUpsertContent } from "@stackone/stackone-client-ts/funcs/lmsUpsertContent.js";
import { CreateCategoriesApiModelSchemasValue, LanguageEnumValue } from "@stackone/stackone-client-ts/sdk/models/shared";

// Use `StackOneCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const stackOne = new StackOneCore({
  security: {
    password: "",
    username: "",
  },
});

async function run() {
  const res = await lmsUpsertContent(stackOne, {
    lmsUpsertContentRequestDto: {
      active: true,
      additionalData: [
        {
          id: "learning_outcomes",
          remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
          value: "This is additional data",
        },
        {
          id: "learning_outcomes",
          remoteId: "8187e5da-dc77-475e-9949-af0f1fa4e4e3",
          value: "This is additional data",
        },
      ],
      authors: [
        {
          id: "123",
          name: "John Doe",
        },
      ],
      categories: [
        {
          id: "16873-IT345",
          language: {
            value: CreateCategoriesApiModelSchemasValue.EnGB,
          },
          name: "Information-Technology",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
        },
        {
          id: "16873-IT345",
          language: {
            value: CreateCategoriesApiModelSchemasValue.EnGB,
          },
          name: "Information-Technology",
          unifiedCustomFields: {
            "my_project_custom_field_1": "REF-1236",
            "my_project_custom_field_2": "some other value",
          },
        },
      ],
      contentUrl: "https://www.youtube.com/watch?v=16873",
      coverUrl: "https://www.googledrive.com/?v=16873",
      createdAt: new Date("2021-07-21T14:00:00.000Z"),
      description: "This video acts as learning content for software engineers.",
      duration: "P3Y6M4DT12H30M5S",
      externalReference: "SOFTWARE-ENG-LV1-TRAINING-VIDEO-1",
      languages: [
        {
          value: LanguageEnumValue.EnGB,
        },
      ],
      localizations: [
        {
          description: "This course acts as learning resource for software engineers.",
          title: "Software Engineer Lv 1",
        },
        {
          description: "This course acts as learning resource for software engineers.",
          title: "Software Engineer: A comprehensive guide",
        },
      ],
      mobileLaunchContentUrl: "https://www.mobile.youtube.com/watch?v=16873",
      order: 1,
      passthrough: {
        "other_known_names": "John Doe",
      },
      skills: [
        {
          id: "12345",
          name: "Sales Techniques",
        },
      ],
      tags: [
        "Sales Techniques",
        "Customer Service",
      ],
      title: "Software Engineer Lv 1",
      unifiedCustomFields: {
        "my_project_custom_field_1": "REF-1236",
        "my_project_custom_field_2": "some other value",
      },
      updatedAt: new Date("2021-07-21T14:00:00.000Z"),
    },
    prefer: "heartbeat",
    xAccountId: "<id>",
  });
  if (res.ok) {
    const { value: result } = res;
    console.log(result);
  } else {
    console.log("lmsUpsertContent failed:", res.error);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.LmsUpsertContentRequest ✔️ The request object to use for the request.
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.LmsUpsertContentResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.ForbiddenResponse 403 application/json
errors.NotFoundResponse 404 application/json
errors.RequestTimedOutResponse 408 application/json
errors.ConflictResponse 409 application/json
errors.PreconditionFailedResponse 412 application/json
errors.UnprocessableEntityResponse 422 application/json
errors.TooManyRequestsResponse 429 application/json
errors.InternalServerErrorResponse 500 application/json
errors.NotImplementedResponse 501 application/json
errors.BadGatewayResponse 502 application/json
errors.SDKError 4XX, 5XX */*