REST: Capabilities
Overview
GET /V1/webforms/capabilities tells a client what this store and this integration can do, in one call: the API and document schema versions, the field types installed, the caller's own permissions and form scope, and the numeric limits. Call it each time a client connects and compare schema_digest with the value you cached: when it differs, or when a document arrives with a different digest, read the schemas again.
| Member | Type | Meaning |
|---|---|---|
api_version | string | Management API version (1) |
document_schema_version | string | Version of the form document format (4.0) |
schema_digest | string | Digest of the field-type catalog and schemas. The same value is returned by REST: Schema and with every document; when it changes, read the schemas again |
field_types | string[] | Field type codes available on this store, add-on types included |
features_json | JSON string | The caller's permissions and switches, see below |
limits_json | JSON string | Limits a request can hit, see below |
features_json:
| Key | Meaning |
|---|---|
permissions | Object of permission short names (forms_view, forms_edit, forms_scripts, results_pii_direct …, plus sales_orders_view and results_approve) set to true or false for the calling integration |
pii_direct | The integration reads personal data in the clear (Disclose Personal Data) |
pii_grants | The integration may request temporary disclosure grants |
export, attachments, drafts | The integration may export submissions, download attachments, edit drafts (drafts follows forms_edit) |
form_scope | all (every form), selected (only the forms ticked on the integration) or none (no form is ticked) |
limits_json:
| Key | Value on a standard install | Applies to |
|---|---|---|
page_size_max | 100 | Items per page of a list or search; a larger pageSize is reduced to it |
page_max | 1000 | Highest page number |
json_bytes_max, json_depth_max | 2097152, 32 | Every JSON-valued argument |
name_chars_max, code_bytes_max | 255, 100 | Form and field names; form and section codes. A field code may be up to 255 bytes (see REST: Drafts) |
note_chars_max, notes_max | 4000, 200 | Notes on one submission |
mass_max | 100 | Submissions in one mass command |
reply_bytes_max, replies_per_hour_max | 20000, 30 | Replies to submitters |
grant_results_max, grant_ttl_max, grants_active_max, grants_per_hour_max | 200, 900, 3, 20 | Temporary disclosure grants (grant_ttl_max in seconds) |
exports_pending_max | 5 | Exports waiting to run |
linked_orders_per_submission, linked_submissions_per_order, order_number_max_length | 50, 50, 50 | Links between submissions and orders |
Read the limits from the response rather than copying this table into a client.
Authentication
OAuth 1.0a integration credentials, as described on REST API. The operation needs forms_view, so a client that relies on this call should always be given that permission.
Operations
| Method | Path | Operation | ACL resource |
|---|---|---|---|
| GET | /V1/webforms/capabilities | FormReadInterface_getCapabilities | MageMe_WebForms::api_v1_forms_view |
Errors
| HTTP | Code | When |
|---|---|---|
| 401 | (Magento) | The request is not signed, the signature is not valid, or the integration lacks forms_view |
| 403 | ACTOR_NOT_ALLOWED | Called with an admin token instead of integration credentials |
Examples
curl https://yourdomain.com/rest/all/V1/webforms/capabilities \
-H "Authorization: <signed-header>"
Response (field types and limits shortened):
{
"api_version": "1",
"document_schema_version": "4.0",
"schema_digest": "sha256:b803f2e1467f9831fb3b7b5c66617e54c39f4a8be8405b72026ac722c85e9efb",
"field_types": ["address", "autocomplete", "callout", "captcha", "colorpicker", "country", "date", "email", "file", "…"],
"features_json": "{\"permissions\":{\"forms_view\":true,\"forms_create\":true,\"forms_edit\":true,\"forms_scripts\":false,\"results_view\":true,\"results_pii_read\":true,\"results_pii_direct\":false,\"results_edit\":true,\"results_reply\":true,\"results_export\":true,\"attachments_read\":true,\"results_import\":true,\"sales_orders_view\":true,\"results_approve\":false},\"pii_direct\":false,\"pii_grants\":true,\"export\":true,\"attachments\":true,\"drafts\":true,\"form_scope\":\"all\"}",
"limits_json": "{\"page_size_max\":100,\"page_max\":1000,\"json_bytes_max\":2097152,\"json_depth_max\":32,\"…\":\"…\"}"
}
The same call with an admin token:
{"message": "This API accepts integration (OAuth 1.0a) credentials only.", "parameters": {"code": "ACTOR_NOT_ALLOWED", "details_schema_version": "1", "details_json": "{}"}}