Skip to content

Latest commit

 

History

History
1889 lines (1479 loc) · 116 KB

File metadata and controls

1889 lines (1479 loc) · 116 KB

Lms

Overview

Available Operations

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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListCoursesRequest(
    xAccountId: '<id>',
    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: new Operations\LmsListCoursesQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listCourses(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListCoursesRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetCourseRequest(
    xAccountId: '<id>',
    id: '<id>',
    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',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getCourse(
    request: $request
);

if ($response->courseResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetCourseRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListUserAssignmentsRequest(
    xAccountId: '<id>',
    id: '<id>',
    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: new Operations\LmsListUserAssignmentsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    userId: 'c28xyrc55866bvuv',
    remoteUserId: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48',
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listUserAssignments(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListUserAssignmentsRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$lmsCreateAssignmentRequestDto = new Components\LmsCreateAssignmentRequestDto(
    passthrough: [
        'other_known_names' => 'John Doe',
    ],
    learningObjectId: 'e3gd34-23tr21-er234-345er56',
    progress: 40,
    assignedAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
    dueDate: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
    status: new Components\LmsCreateAssignmentRequestDtoStatus(
        value: Components\LmsCreateAssignmentRequestDtoValue::InProgress,
    ),
    learningObjectExternalReference: 'learning-content-123',
);

$response = $sdk->lms->createUserAssignment(
    xAccountId: '<id>',
    id: '<id>',
    lmsCreateAssignmentRequestDto: $lmsCreateAssignmentRequestDto,
    prefer: 'heartbeat'

);

if ($response->createResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
lmsCreateAssignmentRequestDto Components\LmsCreateAssignmentRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetUserAssignmentRequest(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getUserAssignment(
    request: $request
);

if ($response->assignmentResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetUserAssignmentRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$lmsBatchUpsertContentRequestDto = new Components\LmsBatchUpsertContentRequestDto(
    items: [
        new Components\LmsUpsertContentRequestDto(
            unifiedCustomFields: [
                'my_project_custom_field_1' => 'REF-1236',
                'my_project_custom_field_2' => 'some other value',
            ],
            title: 'Software Engineer Lv 1',
            description: 'This video acts as learning content for software engineers.',
            languages: [
                new Components\LanguageEnum(
                    value: Components\LanguageEnumValue::EnGB,
                ),
            ],
            contentUrl: 'https://www.youtube.com/watch?v=16873',
            mobileLaunchContentUrl: 'https://www.mobile.youtube.com/watch?v=16873',
            coverUrl: 'https://www.googledrive.com/?v=16873',
            active: true,
            duration: 'P3Y6M4DT12H30M5S',
            skills: [
                new Components\CreateSkillsApiModel(
                    id: '12345',
                    name: 'Sales Techniques',
                ),
            ],
            order: 1,
            localizations: [
                new Components\LocalizationModel(
                    title: 'Software Engineer Lv 1',
                    description: 'This course acts as learning resource for software engineers.',
                ),
                new Components\LocalizationModel(
                    title: 'Software Engineer: A comprehensive guide',
                    description: 'This course acts as learning resource for software engineers.',
                ),
            ],
            tags: [
                'Sales Techniques',
                'Customer Service',
            ],
            authors: [
                new Components\AuthorModel(
                    id: '123',
                    name: 'John Doe',
                ),
            ],
            updatedAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
            createdAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
            externalReference: 'SOFTWARE-ENG-LV1-TRAINING-VIDEO-1',
            categories: [
                new Components\CreateCategoriesApiModel(
                    id: '16873-IT345',
                    unifiedCustomFields: [
                        'my_project_custom_field_1' => 'REF-1236',
                        'my_project_custom_field_2' => 'some other value',
                    ],
                    name: 'Information-Technology',
                    language: new Components\CreateCategoriesApiModelLanguage(
                        value: Components\CreateCategoriesApiModelLanguageValue::EnGB,
                    ),
                ),
            ],
            additionalData: [
                new Components\AdditionalData(
                    id: 'learning_outcomes',
                    remoteId: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
                    value: 'This is additional data',
                ),
            ],
        ),
    ],
);

$response = $sdk->lms->batchUpsertContent(
    xAccountId: '<id>',
    lmsBatchUpsertContentRequestDto: $lmsBatchUpsertContentRequestDto,
    prefer: 'heartbeat'

);

if ($response->batchResultApiModel !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
lmsBatchUpsertContentRequestDto Components\LmsBatchUpsertContentRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$lmsUpsertContentRequestDto = new Components\LmsUpsertContentRequestDto(
    unifiedCustomFields: [
        'my_project_custom_field_1' => 'REF-1236',
        'my_project_custom_field_2' => 'some other value',
    ],
    title: 'Software Engineer Lv 1',
    description: 'This video acts as learning content for software engineers.',
    languages: [
        new Components\LanguageEnum(
            value: Components\LanguageEnumValue::EnGB,
        ),
    ],
    contentUrl: 'https://www.youtube.com/watch?v=16873',
    mobileLaunchContentUrl: 'https://www.mobile.youtube.com/watch?v=16873',
    coverUrl: 'https://www.googledrive.com/?v=16873',
    active: true,
    duration: 'P3Y6M4DT12H30M5S',
    skills: [
        new Components\CreateSkillsApiModel(
            id: '12345',
            name: 'Sales Techniques',
        ),
    ],
    order: 1,
    localizations: [
        new Components\LocalizationModel(
            title: 'Software Engineer Lv 1',
            description: 'This course acts as learning resource for software engineers.',
        ),
        new Components\LocalizationModel(
            title: 'Software Engineer: A comprehensive guide',
            description: 'This course acts as learning resource for software engineers.',
        ),
    ],
    tags: [
        'Sales Techniques',
        'Customer Service',
    ],
    authors: [
        new Components\AuthorModel(
            id: '123',
            name: 'John Doe',
        ),
    ],
    updatedAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
    createdAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
    passthrough: [
        'other_known_names' => 'John Doe',
    ],
    externalReference: 'SOFTWARE-ENG-LV1-TRAINING-VIDEO-1',
    categories: [
        new Components\CreateCategoriesApiModel(
            id: '16873-IT345',
            unifiedCustomFields: [
                'my_project_custom_field_1' => 'REF-1236',
                'my_project_custom_field_2' => 'some other value',
            ],
            name: 'Information-Technology',
            language: new Components\CreateCategoriesApiModelLanguage(
                value: Components\CreateCategoriesApiModelLanguageValue::EnGB,
            ),
        ),
    ],
    additionalData: [
        new Components\AdditionalData(
            id: 'learning_outcomes',
            remoteId: '8187e5da-dc77-475e-9949-af0f1fa4e4e3',
            value: 'This is additional data',
        ),
    ],
);

$response = $sdk->lms->upsertContent(
    xAccountId: '<id>',
    lmsUpsertContentRequestDto: $lmsUpsertContentRequestDto,
    prefer: 'heartbeat'

);

if ($response->upsertResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
lmsUpsertContentRequestDto Components\LmsUpsertContentRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListContentRequest(
    xAccountId: '<id>',
    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: new Operations\LmsListContentQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listContent(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListContentRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetContentRequest(
    xAccountId: '<id>',
    id: '<id>',
    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',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getContent(
    request: $request
);

if ($response->contentResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetContentRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListUserCompletionsRequest(
    xAccountId: '<id>',
    id: '<id>',
    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: new Operations\LmsListUserCompletionsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listUserCompletions(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListUserCompletionsRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

createUserCompletion

Create a completed learning record for a user.

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

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$lmsCreateCompletionRequestDto = new Components\LmsCreateCompletionRequestDto(
    passthrough: [
        'other_known_names' => 'John Doe',
    ],
    completedAt: Utils\Utils::parseDateTime('2021-07-21T14:00:00.000Z'),
    learningObjectId: 'e3gd34-23tr21-er234-345er56',
    timeSpent: 'PT1H30M45S',
    score: new Components\LmsCreateCompletionRequestDtoScore(
        percentage: 87,
        rawValue: '87 / 100',
    ),
    learningObjectExternalReference: 'learning-content-123',
);

$response = $sdk->lms->createUserCompletion(
    xAccountId: '<id>',
    id: '<id>',
    lmsCreateCompletionRequestDto: $lmsCreateCompletionRequestDto,
    prefer: 'heartbeat'

);

if ($response->createResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
lmsCreateCompletionRequestDto Components\LmsCreateCompletionRequestDto ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetUserCompletionRequest(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getUserCompletion(
    request: $request
);

if ($response->completionResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetUserCompletionRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();



$response = $sdk->lms->deleteUserCompletion(
    xAccountId: '<id>',
    id: '<id>',
    subResourceId: '<id>',
    prefer: 'heartbeat'

);

if ($response->deleteResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description Example
xAccountId string ✔️ The account identifier
id string ✔️ N/A
subResourceId string ✔️ N/A
prefer ?string Set to "heartbeat" to enable keep-alive newline heartbeats during long-running requests. Response includes Preference-Applied: heartbeat header when honored. (RFC 7240) heartbeat

Response

?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\SDKException 4XX, 5XX */*

listCompletions

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

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListCompletionsRequest(
    xAccountId: '<id>',
    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: new Operations\LmsListCompletionsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listCompletions(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListCompletionsRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

getCompletion

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

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetCompletionRequest(
    xAccountId: '<id>',
    id: '<id>',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getCompletion(
    request: $request
);

if ($response->completionResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetCompletionRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

getCategory

Get Category

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetCategoryRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,name,active,hierarchy,level,language,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getCategory(
    request: $request
);

if ($response->categoryResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetCategoryRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

listCategories

List Categories

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListCategoriesRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,name,active,hierarchy,level,language,unified_custom_fields',
    filter: new Operations\LmsListCategoriesQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listCategories(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListCategoriesRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

listUsers

List Users

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListUsersRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields',
    filter: null,
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listUsers(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListUsersRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

getUser

Get User

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetUserRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,external_reference,active,email,phone_number,created_at,updated_at,name,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getUser(
    request: $request
);

if ($response->userResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetUserRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

getSkill

Get Skill

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetSkillRequest(
    xAccountId: '<id>',
    id: '<id>',
    fields: 'id,remote_id,name,active,hierarchy,language,unified_custom_fields',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getSkill(
    request: $request
);

if ($response->skillResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetSkillRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*

listSkills

List Skills

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListSkillsRequest(
    xAccountId: '<id>',
    fields: 'id,remote_id,name,active,hierarchy,language,unified_custom_fields',
    filter: new Operations\LmsListSkillsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listSkills(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListSkillsRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;
use StackOne\client\Utils;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsListAssignmentsRequest(
    xAccountId: '<id>',
    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: new Operations\LmsListAssignmentsQueryParamFilter(
        updatedAfter: Utils\Utils::parseDateTime('2020-01-01T00:00:00.000Z'),
    ),
    userId: 'c28xyrc55866bvuv',
    remoteUserId: 'e3cb75bf-aa84-466e-a6c1-b8322b257a48',
    prefer: 'heartbeat',
);

$responses = $sdk->lms->listAssignments(
    request: $request
);


foreach ($responses as $response) {
    if ($response->statusCode === 200) {
        // handle response
    }
}

Parameters

Parameter Type Required Description
$request Operations\LmsListAssignmentsRequest ✔️ The request object to use for the request.

Response

?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\SDKException 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

declare(strict_types=1);

require 'vendor/autoload.php';

use StackOne\client;
use StackOne\client\Models\Components;
use StackOne\client\Models\Operations;

$sdk = client\StackOne::builder()
    ->setSecurity(
        new Components\Security(
            username: '',
            password: '',
        )
    )
    ->build();

$request = new Operations\LmsGetAssignmentRequest(
    xAccountId: '<id>',
    id: '<id>',
    prefer: 'heartbeat',
);

$response = $sdk->lms->getAssignment(
    request: $request
);

if ($response->assignmentResult !== null) {
    // handle response
}

Parameters

Parameter Type Required Description
$request Operations\LmsGetAssignmentRequest ✔️ The request object to use for the request.

Response

?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\SDKException 4XX, 5XX */*