Create or update widget
Overview
Create a new widget, or update an existing one when you supply unique_id. Requires the location to have an active widget add-on; a new widget gets a hashid unique_id generated from its id after the first save.
Prerequisites
- A bearer token. Callable with Partner and Account tokens.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
POST /api/v1/account/widget/update
Authentication
-
Requires a bearer token in the
Authorization: Bearer <bearer-token>header. -
Who can call it: Partner and Account tokens.
-
Authentication in the role-agnostic
account/*group (route nameapi.brand.widget.update). No HiPages gate. -
store_idmust sit inside your own account tree (auth user's company-hierarchy walk). -
Note: despite the controller's OpenAPI annotation listing
company_idas an alternative, the endpoint makesstore_idrequired for every role.company_idis NOT a request field here and is only set from$validated['company_id'](always null in practice). -
Both roles use the same params. A partner can target stores anywhere in its tree, an account user only its own.
Rate limit
- No rate limit.
Request body
- Body:
| Field | Type | Required | Description |
|---|---|---|---|
store_id | integer | required | Must Must be an existing location and pass an ownership check. Also used for the active-add-on check. |
widget_type_id | integer | required | Must Must be an existing widget type. |
unique_id | string | optional | When present (hashid decode must resolve to a Widget whose unique_id matches); switches the call to update that widget. |
widget_title | string | optional | max 255. |
widget_options | array/object | optional | Arbitrary widget config JSON (e.g. numberOfReviews, reviewSiteValue.value). |
{
"store_id": 12,
"widget_type_id": 1,
"widget_title": "My Feed Widget",
"widget_options": {
"numberOfReviews": 3,
"reviewSiteValue": {
"value": 5
}
}
}Response
data.message(string)data.status(string) —successdata.data.unique_id(string) — the saved widget's hashid code
200 OK · 200
200{
"data": {
"message": "Widget has been saved successfully",
"status": "success",
"data": { "unique_id": "abc123" }
}
}400 No active widget add-on · 400
400{
"message": "You do not have any active widget add-ons. Please add an add-on to your location in order to access the widget features.",
"status": "error",
"errors": []
}422 Validation error · 422
422{
"message": "The widget type id field is required.",
"errors": {
"widget_type_id": ["The widget type id field is required."],
"store_id": ["The store id field is required."]
}
}402 Feature limit reached · 402
402{
"status": "error",
"message": "Review Widgets limit reached for this period.",
"feature": "review_widgets",
"remaining": 0,
"hard_stop": true
}Errors
| Status | Meaning |
|---|---|
400 | No active widget add-on |
401 | The bearer token is missing, expired or invalid |
402 | Creating a new widget is blocked because the review-widgets limit of your plan is reached (X-Feature-* headers give the details) |
422 | Validation error |
500 | Unexpected server error |
Example request
curl --request POST \
--url "https://production-api.shoutaboutus.com/api/v1/account/widget/update" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"store_id": 12, "widget_type_id": 1, "widget_title": "My Feed Widget", "widget_options": {"numberOfReviews": 3, "reviewSiteValue": {"value": 5}}}'Updated 9 days ago
