Webform REST

Component ID

2854742

Component name

Webform REST

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Downloads

378

Component created

Component changed

Component body

Retrieve and submit webforms via REST. Requires the dev version of Webform.

  1. Enable module
  2. Enable REST resource "Webform Submit"
  3. Enable REST resource "Webform Elements"

Retrieve Webform

Version 1.x

GET /webform_rest/elements/webform_id?_format=hal_json

Version 2.x

GET /webform_rest/webform_id/elements?_format=hal_json

To examine the response format, use Restlet Client Chrome plugin or similar.

Submit Webform

POST /webform_rest/submit

Example POST data:

{
  "webform_id": "my_webform",
  "checkboxes_field": [
    "Option 3",
    "Option 5"
   ],
   "integer_field": 3,
   "radio_field": "Mail",
   "email": "myemail@mydomain.com.au"
}

Version 2.x

Version 2.x changes the endpoints to use a different path. The webform ID is now specified before the action rather than after.

E.g.

/webform_rest/webform_id/elements?_format=hal_json

This version may get new features while version 1 will receive bug fixes only.