Create multiple pages

Method Description
course.pageCreateBatch Create multiple learning pages in one call.

Creates up to 50 learning pages in a single call, all in the same course - every entry's {CourseId} must be identical, or the whole call is rejected before anything is created. Appended to the table of contents in the order given. Each entry in pages is shaped exactly like a single course.pageCreate request - see that page for the full description of the page/resources fields, which are identical here.

Partial success: every entry is validated and saved independently - one invalid page does not block the others. The response lists a per-entry result in the same order (and of the same length) as the request's pages array.

Request parameters

{
    "pages": [
        {
            "page": {
                "course_id": {CourseId},
                "name": "{PageName}",
                "description": "{PageDescription}",
                "external_id": "{ExternalId}"
            },
            "resources": {
                "{ResourcePath}": "{ResourceCnt}",
                ...
            }
        },
        ...
    ]
}

Response parameters

{
    "results": [
        // example entry for a page that was created successfully
        {
            "index": {ResultIndex},
            "completed": true,
            "page": { ... same shape as course.pageCreate's "page" response ... },
            "resources": { ... }
        },
        // example entry for a page that failed validation and was not created
        {
            "index": {ResultIndex},
            "completed": false,
            "error": "{ResultError}"
        }
        // ... one entry per submitted page, in the same order as the request's "pages" array ...
    ],
    "created_count": {CreatedCount},
    "failed_count": {FailedCount}
}

Parameters meaning

Variable Type Appearance Description
pages Array Mandatory One entry per page to create. Must be non-empty and contain no more than 50 entries, or the whole call is rejected before any page is created.
page, resources Object Mandatory Identical in shape and meaning to the page/resources nodes of course.pageCreate's request - see that page for the full field list ({CourseId}, {PageName}, {PageDescription}, {ExternalId}, and media resource handling).
response
results Array Mandatory One entry per requested page, in the same order as the request's pages array.
{ResultIndex} Integer Mandatory 0-based position of this entry within the request's pages array.
{Completed} Boolean Mandatory Whether this specific page was created - same field, same meaning, as a single course.pageCreate call's own {Completed}. When true, the rest of the entry is the same page/resources shape a single course.pageCreate call returns. When false, only {ResultError} is present.
{ResultError} String Optional Present only when {Completed} is false. The validation error(s) for this specific entry - the same message course.pageCreate itself would have returned for this entry alone.
{CreatedCount} Integer Mandatory Number of entries successfully created.
{FailedCount} Integer Mandatory Number of entries that failed validation and were not created.