Feedback Portals

POST /feedback_portal/{portalId}/widget/{widgetId}/events

Changed on

Tell Craft that the widget was opened, or submitted, on your page.

Fire and forget. 202 with no body, and the body means nothing beyond "received". Do not retry it, do not wait for it before showing your form, and never let it fail a submission — a relay that breaks the thing it measures is worse than no measurement.

What to send. eventName is beWidgetOpened (the form was shown to somebody) or beWidgetSubmitted. Everything else is optional context about the page:

{ "eventName": "beWidgetOpened", "widgetVersion": "v1",
  "browser": "<navigator.userAgent>", "mobile": false, "categoriesSize": 3 }

portalId and widgetId may also be sent and must then match the path, which is what counts.

Nothing about the person reaches Craft through this endpoint — no page URL, nothing typed into the form, no identity. An unlisted property is a 422 rather than a silent drop, so a typo is something you see on your first attempt instead of a series that never arrives.

Takes the same three credentials as the config read: a widget token, a development key, or an account API key.

Request

  • Base URL
    https://api.craft.io
  • URL
    https://api.craft.io/feedback_portal/{portalId}/widget/{widgetId}/events
  • Auth
    API key in header x-api-key

Path parameters

portalIdstring required
widgetIdstring required

Request body

eventNamestring required

What happened. beWidgetOpened — the form was shown to somebody. beWidgetSubmitted — they submitted it. Anything else is a 422 listing the two.

portalIdstring

Optional, and must match the portal in the path when sent. The path is what counts.

widgetIdstring

Optional, and must match the widget in the path when sent.

widgetVersionstring

The widget bundle's own version, e.g. v1.

browserstring

The browser's user-agent string, up to 256 characters.

mobileboolean

Whether it was drawn on a phone-sized screen.

categoriesSizenumber double

How many categories this widget offered on this open.

Response

Received — no body, and nothing to retry

Changes