List embed packages
const url = 'https://example.com/wp-json/wp2lms-pro/embed-packages/v1/packages?blog_id=1';const options = {method: 'GET', headers: {'X-WP-Nonce': '<X-WP-Nonce>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/wp-json/wp2lms-pro/embed-packages/v1/packages?blog_id=1' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Lists CPT wp2lms_embed_pkg posts on site blog_id: get_posts with statuses publish/draft/private, no pagination (posts_per_page = -1), ordered by title ASC. Each row is package_payload (id, title, status, launch_url, meta).
This is not a content_type filter and not a WordPress page catalog: packages only. Trash is excluded. An empty site returns { "packages": [], "blog_id": N }.
Requires manage_network (multisite) or edit_pages (single site). Cookie + X-WP-Nonce or Application Password.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Network site ID (switch_to_blog). Optional: defaults to the request current blog. Not a package id and not page_id. Minimum 1; on a single site it must match the current site — otherwise 400 embed_packages_invalid_blog. In a network an unknown site or a site from another network is 404 embed_packages_unknown_blog.
Example
1Responses
Section titled “Responses”Package list for the current (or switched) blog. Body blog_id is get_current_blog_id() after switch.
object
package_payload response — CPT post plus flattened meta fields and the full meta object.
object
CPT wp2lms_embed_pkg post ID. Same number as {id} in GET/PATCH/DELETE/content/materialize-pages paths.
Package post_title. After ingest PHP may replace it with the launch file <title>.
Package post_status. REST accepts publish/draft/private; the response is whatever is stored.
Copy of meta.content_type (web / scorm1.2 / scorm2004 / xapi or empty).
Copy of meta.content_tool (authoring-tool detector or empty string).
Copy of meta.launch_path — relative launch HTML, not a URL.
Absolute launch URL (uploads baseurl + storage_rel + launch_path). Empty when there is no content.
Copy of meta.activity_id.
Copy of meta.storage_rel under uploads.
Copy of meta.is_multipage.
object
Relative HTML path inside the package directory (posix, no leading /). From PackagePagesIndex::scan.
Title from the file <title> tag, or the basename if the tag is missing.
Full post meta array _wp2lms_embed_package (PackageMeta::get). Empty object when the package has not been ingested.
object
Type after ManifestPipeline — web, scorm1.2, scorm2004, or xapi. Empty until content is uploaded.
Version from the manifest (for SCORM often the same as content_type). Empty string for typical web packages.
XAPI activity id. If the parser omitted it — {home}wp2lms-embed-package/{id}.
Relative launch HTML inside storage (from the manifest or fallback index.html).
Title from launch HTML / manifest; PHP may overwrite the package post_title with this value.
Mastery score from imsmanifest (SCORM), otherwise null.
Authoring-tool detector: ispring, articulate_rise, articulate_storyline, articulate_presenter, captivate, elucidat, or an empty string.
Path from uploads basedir, wp2lms-embed-packages/{id}/.
Unix time of the last successful content write (time() in finalize).
True only for content_type=web with no content_tool and ≥2 HTML files in the index.
HTML index (path+title) when the package is multipage; otherwise [].
object
Relative HTML path inside the package directory (posix, no leading /). From PackagePagesIndex::scan.
Title from the file <title> tag, or the basename if the tag is missing.
Current blog ID after switch.
Example
{ "packages": [ { "id": 42, "title": "Interactive lesson", "status": "publish", "content_type": "web", "content_tool": "", "launch_path": "index.html", "launch_url": "https://lms.example.com/wp-content/uploads/wp2lms-embed-packages/42/index.html", "activity_id": "https://lms.example.com/wp2lms-embed-package/42", "storage_rel": "wp2lms-embed-packages/42/", "is_multipage": false, "pages": [], "meta": { "content_type": "web", "version": "", "activity_id": "https://lms.example.com/wp2lms-embed-package/42", "launch_path": "index.html", "title": "Interactive lesson", "mastery_score": null, "content_tool": "", "storage_rel": "wp2lms-embed-packages/42/", "uploaded_at": 1726252800, "pages": [], "is_multipage": false } } ], "blog_id": 1}Embed_packages_invalid_blog — blog_id < 1, or on a single site it does not match the current site.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Not authenticated. WordPress REST: rest_forbidden (status 401) when there is no cookie session. Cookie + X-WP-Nonce or Application Password.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Missing manage_network (multisite) or edit_pages (single site), or invalid REST nonce (rest_cookie_invalid_nonce).
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}Embed_packages_unknown_blog — that site does not exist in the network, or it belongs to another network.
object
WP_Error code (get_error_code()), e.g. embed_packages_not_found.
WP_Error text (get_error_message()).
WP_Error data. Usually { "status": 404 }. Ingest/materialize errors without status are returned by WordPress REST as 500.
object
Example
{ "code": "embed_packages_not_found", "message": "Package not found.", "data": { "status": 404 }}