This project is not covered by Drupal’s security advisory policy.

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"
  4. Enable REST resource "Webform Submission" (2.x only)

There may be 2 Webform Submission resources. The one provided by this module has the path: /webform_rest/{webform_id}/submission/{sid}

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.

Retrieve Webform

GET /webform_rest/webform_id/elements?_format=hal_json

Retrieve Webform Submission

GET /webform_rest/webform_id/submission/sid?_format=hal_json

Example response:

{
  "entity": {
    "serial": [
      {
        "value": 1
      }
    ],
    "sid": [
      {
        "value": 1
      }
    ],
    "uuid": [
      {
        "value": "f796859a-7d65-471a-b794-d6c4ea83ab49"
      }
    ]
  // More entity fields including token, completed, in_draft etc.
  },
  "data": {
    "checkboxes_field": [
      "Option 3",
      "Option 5"
     ],
     "integer_field": 3,
     "radio_field": "Mail",
     "email": "myemail@mydomain.com.au"
  }
}

Version 1.x

Retrieve Webform

GET /webform_rest/elements/webform_id?_format=hal_json

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

Supporting organizations: 

Project information

Downloads