REST: Statuses
Overview
GET /V1/webforms/statuses lists the submission statuses of the store, the list an administrator keeps in
Content → WebForms → Submission Statuses. The API addresses a status by its code: the set-status and
mass-status commands on REST: Results take it as status_code, and every
submission read returns it as status_code.
The list is read-only through the API. Statuses are added, changed and retired in the admin, see Statuses.
The response holds items, total_count and search_criteria, which is always null because the list has no
paging. Each item:
| Member | Meaning |
|---|---|
id | Status id |
code | The code the submission commands take, for example in-progress |
label | The name shown in the admin |
color | Color of the status badge, a hex value |
state | 1 active; 2 being retired: no submission can be given it any more, and the submissions that have it are moved to another status |
is_notify_customer | Whether setting this status fires the form's status change notifications |
Which statuses a submission can take
The list is store-wide; each form offers part of it. A form's statuses and its default status are chosen on the
form in the admin. They appear, read-only, in the form's document as custom_status_subset, for example
{"statuses": ["in-progress", "new", "resolved"], "default": "new"}; see
REST: Forms. set-status refuses with 400 VALIDATION_FAILED a status the
form doesn't offer, a status being retired, and any status on a form with statuses switched off.
Authentication
OAuth 1.0a integration credentials, as described on REST API.
Reading statuses needs results_view.
Operations
| Method | Path | Operation | ACL resource |
|---|---|---|---|
| GET | /V1/webforms/statuses | SubmissionInterface_statuses | MageMe_WebForms::api_v1_results_view |
Errors
This route has no errors of its own. The refusals every route shares are listed on REST API.
Examples
curl https://yourdomain.com/rest/all/V1/webforms/statuses \
-H "Authorization: <signed-header>"
<signed-header> stands for the OAuth 1.0a Authorization header computed for this request by your OAuth library.
The response, trimmed to four statuses:
{
"items": [
{"id": 2, "code": "in-progress", "label": "In Progress", "color": "#f9a825", "state": 1, "is_notify_customer": false},
{"id": 3, "code": "resolved", "label": "Resolved", "color": "#1565c0", "state": 1, "is_notify_customer": true},
{"id": 14, "code": "new", "label": "New", "color": "#2563eb", "state": 1, "is_notify_customer": false},
{"id": 16, "code": "waiting", "label": "Waiting for Customer", "color": "#d97706", "state": 1, "is_notify_customer": true}
],
"search_criteria": null,
"total_count": 4
}
set-status with a status the form doesn't offer:
{"message": "This status is not enabled for the form.", "parameters": {"code": "VALIDATION_FAILED", "details_schema_version": "1", "details_json": "{}"}}