Get runner data
const url = 'https://example.com/wp-json/wp2tutor-forms/form/v1/getRunnerData?id=42';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/wp2tutor-forms/form/v1/getRunnerData?id=42' \ --header 'X-WP-Nonce: <X-WP-Nonce>'Returns the payload the runner uses to mount the form: the container HTML id, window global names for translations/locale, and the props object. This is not /i18n/v1/* and not Gravity Forms: form_id is the string wp2lms-form-{id} of a wp2tutor_form CPT post.
Query id is required. Capability is the same as update*: edit_post on that post (the route is not public). There is no request token.
translations_variable / locale_variable are JS global names (WP2TutorFormTranslations, WP2TutorFormLocale), not the dictionaries themselves. The runner template reads window[translations_variable][props.runner] and window[locale_variable]. The i18n JSON is not included in this response.
props is the form snapshot plus runner fields: element (= form_id), language always ru_RU, sectionsToSave — unique repeatSectionId values from the definition. The rest is FormPost::get_props() (id, token, runner, definition, styles, l10n, hooks, trackers, shortcode, hardcoded results/entries/tier, base64 data, open from query open).
Cookie + X-WP-Nonce or Application Password.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”ID of the wp2tutor_form CPT post. Not Gravity Forms. PHP casts to int. Missing post is 404 post_not_found; wrong CPT is 400 invalid_post_type.
Example
42Responses
Section titled “Responses”Runner snapshot: form_id, window global names, and props.
object
HTML id of the runner container. PHP: 'wp2lms-form-' . FormPost::get_id(). A string, not a Gravity Forms number and not the bare post ID.
Window global name for runner translations. Constant FormRunnerAssetsManager::JS_TRANSLATIONS_VAR = WP2TutorFormTranslations. Template: window[translations_variable][props.runner]. The dictionary itself is not in this response.
Window global name for the locale pack. Constant JS_LOCALE_VAR = WP2TutorFormLocale. Template: window[locale_variable]. Contents of locales/*.json are not duplicated here.
initWP2TutorForm payload. PHP: element + FormPost::get_props() + hardcoded language = ru_RU + sectionsToSave from repeatSectionId in the definition.
object
Same id as form_id (wp2lms-form-{id}). Where the runner mounts the UI.
Numeric ID of the wp2tutor_form post (WP_Post->ID).
Current snapshot md5 (generate_token) — the same algorithm the client sends on update*.
Current UI runner from meta runner; empty meta defaults to autoscroll.
PHP always returns an empty string.
Decoded JSON of post_content (not a string). Tripetto shape: name, clusters, nodes, and so on.
object
Decoded meta styles. Empty meta is [].
object
Decoded meta l10n for this form. Empty meta is [].
object
Decoded meta hooks. Empty meta is [].
object
Decoded meta trackers. Empty meta is [].
object
Decoded meta shortcode. After create_new: fullPage, width, height, css.
object
PHP always true.
PHP always 1.
PHP always pro.
Base64 JSON inventory of Tripetto variables (Variables::inventory()): keys user:*, website:*, visitor:*, server:* with description/value. Empty inventory is an empty string.
$_GET['open'] of the current request, or null. Not a registered REST arg; it appears in props if query open is present.
get_runner_data always sets ru_RU (not get_locale() and not a query param).
Unique non-empty repeatSectionId values from the definition (recursive walk). None — [].
Example
{ "form_id": "wp2lms-form-42", "translations_variable": "WP2TutorFormTranslations", "locale_variable": "WP2TutorFormLocale", "props": { "element": "wp2lms-form-42", "id": 42, "token": "a1b2c3d4e5f60718293a4b5c6d7e8f90", "runner": "autoscroll", "shareUrl": "", "definition": { "name": "Form", "language": "ru_RU", "clusters": [] }, "styles": { "display": "inline", "autoFocus": false }, "l10n": {}, "hooks": [], "trackers": [], "shortcode": { "fullPage": false, "width": "", "height": "", "css": "" }, "results": true, "entries": 1, "tier": "pro", "data": "eyJ1c2VyOmxvZ2luIjp7ImRlc2NyaXB0aW9uIjoiLi4uIiwidmFsdWUiOiJhZG1pbiJ9fQ==", "open": null, "language": "ru_RU", "sectionsToSave": [] }}Invalid_post_type — post is not CPT wp2tutor_form; invalid_id — same check in the id arg; rest_missing_callback_param — query id is missing.
object
WP_Error code for this API (invalid_token, empty_token, invalid_json, invalid_runner, invalid_permissions, post_not_found, and so on).
Human-readable text from PHP (Invalid token: generated "…", expected "…", Token cannot be empty., Invalid JSON., etc.).
Usually { status: HTTP code } on WP_Error from these controllers.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Not authenticated. WordPress REST: rest_not_logged_in / rest_forbidden. Use cookie + X-WP-Nonce or Application Password.
object
WP_Error code for this API (invalid_token, empty_token, invalid_json, invalid_runner, invalid_permissions, post_not_found, and so on).
Human-readable text from PHP (Invalid token: generated "…", expected "…", Token cannot be empty., Invalid JSON., etc.).
Usually { status: HTTP code } on WP_Error from these controllers.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Invalid_permissions — no edit_post capability on the form post. WordPress REST: rest_forbidden / rest_cookie_invalid_nonce.
object
WP_Error code for this API (invalid_token, empty_token, invalid_json, invalid_runner, invalid_permissions, post_not_found, and so on).
Human-readable text from PHP (Invalid token: generated "…", expected "…", Token cannot be empty., Invalid JSON., etc.).
Usually { status: HTTP code } on WP_Error from these controllers.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}Post_not_found — no post with that id; entity_not_found — FormPost did not find the post in the service.
object
WP_Error code for this API (invalid_token, empty_token, invalid_json, invalid_runner, invalid_permissions, post_not_found, and so on).
Human-readable text from PHP (Invalid token: generated "…", expected "…", Token cannot be empty., Invalid JSON., etc.).
Usually { status: HTTP code } on WP_Error from these controllers.
object
Examplegenerated
{ "code": "example", "message": "example", "data": {}}