GET/v1/public/widget
Resolve a widget site key#
Resolves a site key (created in the console under Widget) for the calling origin. The browser sends Origin; the origin must be in the widget's allowlist or the call answers 403 origin_not_allowed. The site key is public and safe in page source.
Auth. None. This route is public.
Plan. The church needs the widget feature, and it must be on in the church's settings.
- Auth
- No key
- Plan
- The church needs the widget feature, and it must be on in the church's settings.
- Operation id
widgetConfig
Parameters
| Name | In | Description |
|---|---|---|
key | query | The widget's public site key, created in the console under Widget. (string, e.g. wk_live_8f3a1c9d2b7e) |
Origin | header | Sent by the browser: the page making the call. It must be in the widget's allowlist. (string) |
Responses
200 Success. Resolve a widget site key.
{
"status": true,
"message": "widget",
"data": {
"object": "widget",
"church": "grace-chapel",
"name": "Grace Chapel",
"mode": "ask",
"settings": {
"greeting": "Ask about our teaching"
}
}
}400 The request could not be read.
{
"status": false,
"message": "the page cursor is not valid",
"error": {
"code": "invalid_argument",
"status": 400,
"request_id": "req_b337770ecebe03b03a88a8998b59263d"
}
}403 The calling origin is not in the widget's allowlist.
{
"status": false,
"message": "This site is not allowed to use this widget.",
"error": {
"code": "origin_not_allowed",
"status": 403,
"request_id": "req_b337770ecebe03b03a88a8998b59263d"
}
}422 A field failed validation, or an Idempotency-Key was reused with a different body.
{
"status": false,
"message": "A field is not valid.",
"error": {
"code": "validation",
"status": 422,
"request_id": "req_b337770ecebe03b03a88a8998b59263d"
}
}500 Something went wrong. Quote error.request_id.
{
"status": false,
"message": "Something went wrong. Quote the request id to support.",
"error": {
"code": "internal",
"status": 500,
"request_id": "req_b337770ecebe03b03a88a8998b59263d"
}
}Code samples
curl -X GET "$FOLIO_API_URL/v1/public/widget?key=wk_live_8f3a1c9d2b7e"