API 参考
Forms
Content Delivery API: GET /forms/{id}, GET /forms/{id}/challenge, POST /forms/{id}/upload-request, …
Parameters
idstring · pathrequiredlocalestring · queryLocale for the form name, description, question labels, hints, choice labels, submit button and success message. One of the site's locales from /site (a code such as `en-US` or the URL prefix such as `en`); omit it for the primary locale. Other values, including locales that are still translating, return 400 UNSUPPORTED_LOCALE. Untranslated fields fall back to the primary locale. Field and choice ids are locale-independent, so submissions are unaffected.
Response 200
formobjectrequired
Errors
FORM_NOT_FOUND404UNSUPPORTED_LOCALE400
curl -X GET "https://{site}/api/v1/forms/{id}"Get the bot check for submitting a form (built-in proof-of-work or the site's third-party widget)
/forms/{id}/challengeParameters
idstring · pathrequired
Response 200
provider"kanorio" | "turnstile" | "recaptcha" | "hcaptcha"requiredentry"forms" | "customer_login"requiredaltchaobjectBuilt-in proof-of-work challenge (provider kanorio only).
altcha.algorithmstringrequiredaltcha.challengestringrequiredaltcha.maxnumberintegeraltcha.saltstringrequiredaltcha.signaturestringrequiredsiteKeystringWidget site key (third-party providers).
actionstringPass this as the widget action; the server checks it.
cDatastring | nullTurnstile cData to pass to the widget; null for other providers.
recaptchaVersion"v2" | "v3" | nullvisiblebooleanWhen true, show the check to the visitor instead of running it silently (the site is seeing unusual sign-in volume).
uploadTokenstringForms with a third-party provider only: send this as _tk (with _ctx set to the form id) when requesting file upload tickets. The widget token is single-use, so it is checked on submit instead.
Errors
FORM_NOT_FOUND404
curl -X GET "https://{site}/api/v1/forms/{id}/challenge"Request a signed upload ticket for a form file attachment field
/forms/{id}/upload-requestParameters
idstring · pathrequired
Request body
fieldIdstringrequiredfileNamestringrequiredmimeTypestringrequiredfileSizeintegerrequired_hpstringHoneypot. Send an empty string; any value marks the request as automated.
_wpstringSecond honeypot. Send an empty string.
_costringThird honeypot. Send an empty string.
_tsintegerWhen the form was rendered, in Unix milliseconds.
_tkstringBuilt-in bot check: the solved ALTCHA payload for the challenge (provider kanorio).
_ctxstringWhat the built-in challenge was issued for: the form id, or customer-login:{siteId}.
captchaTokenstringThird-party bot check: the token from the provider's widget (provider turnstile, recaptcha or hcaptcha).
Response 200
uploadIdstringrequireduploadUrlstringrequiredheadersobjectexpiresInintegerrequired
Errors
FORM_NOT_FOUND404INVALID_BODY400FILE_TOO_LARGE413FILE_TYPE_NOT_ALLOWED400UPLOAD_UNAVAILABLE503
curl -X POST "https://{site}/api/v1/forms/{id}/upload-request" \
-H "Content-Type: application/json" \
-d '{}'Parameters
idstring · pathrequired
Request body
answersobjectrequiredAnswers keyed by question id (from GET /forms/{id}).
consent"checked" | "submit_statement"How the visitor agreed: ticked the consent box, or submitted under a consent statement. Omit when the form asks for no consent.
consentTextIdstringId of the consent text the visitor saw (from GET /forms/{id}).
localestringpagePathstringPath of the page the form was on, for the submission record.
_hpstringHoneypot. Send an empty string; any value marks the request as automated.
_wpstringSecond honeypot. Send an empty string.
_costringThird honeypot. Send an empty string.
_tsintegerWhen the form was rendered, in Unix milliseconds.
_tkstringBuilt-in bot check: the solved ALTCHA payload for the challenge (provider kanorio).
_ctxstringWhat the built-in challenge was issued for: the form id, or customer-login:{siteId}.
captchaTokenstringThird-party bot check: the token from the provider's widget (provider turnstile, recaptcha or hcaptcha).
Response 200
state"closed" | "not_open" | "full"
Errors
FORM_NOT_FOUND404INVALID_BODY400INVALID_ANSWERS400VERIFICATION_EXPIRED400DUPLICATE_SUBMISSION409
curl -X POST "https://{site}/api/v1/forms/{id}/submit" \
-H "Content-Type: application/json" \
-d '{}'