List widget styles
Overview
Get the available widget styles: carousel, grid, badge, and so on.
Use this when building a widget picker.
You'll need a Partner or Account token.
Returns one entry per style. Send store_id to also get widget_add_ons: whether that location has an active widget add-on. Without store_id, widget_add_ons is null.
Prerequisites
- A bearer token. See Authentication.
- Optional: a location id (
store_id) to check its widget add-on.
Base URL
| Environment | URL |
|---|---|
| Production | https://production-api.shoutaboutus.com |
| Development | https://development-api.shoutaboutus.com |
Endpoint
GET /api/v1/widget/type
Authentication
Partner or Account token
store_idandcompany_id, when sent, must be inside your own account tree. A Partner token can check any location under the partner; an Account token only its own.- An id outside your tree, or one that doesn't exist, is rejected with
422.
Rate limit
This endpoint has no rate limit.
Request parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
store_id | query | integer | No | A location to check for an active widget add-on. Must exist and be inside your account tree. When sent, widget_add_ons is filled in. |
company_id | query | integer | No | An account id. Checked (must exist and be inside your account tree) but it doesn't change the response. |
Request body
None.
Request payload
None.
Response body
The payload is inside data.
| Field | Type | Description |
|---|---|---|
status | string | success. |
data | array of objects | The active widget styles. |
data[].id | integer | The style's id. Use it as widget_type_id in Create or update a widget. |
data[].name | string | The style's name. |
data[].icon | string or null | The style's icon name. |
data[].link | string or null | The style's page path in the app. |
data[].status | string | active. |
data[].deleted_at | string or null | Always null: deleted styles aren't listed. |
data[].created_at | string or null | When the style was added, if recorded. |
data[].updated_at | string or null | When the style was last changed, if recorded. |
widget_add_ons | object or null | The widget add-on check for store_id. null when store_id isn't sent. |
widget_add_ons.status | boolean | Whether the location has an active widget add-on. |
widget_add_ons.store_ids | array of integers or null | The location id when it has the add-on; null when it doesn't. |
Response payload
{
"data": {
"status": "success",
"data": [
{
"id": 1,
"name": "Feed Widget",
"icon": "ic:baseline-dynamic-feed",
"link": "/widget/customize-widget",
"status": "active",
"deleted_at": null,
"created_at": null,
"updated_at": null
}
],
"widget_add_ons": {
"status": true,
"store_ids": [
3007
]
}
}
}Examples
Success payload
With store_id: see Response payload.
Without store_id, widget_add_ons is null:
{
"data": {
"status": "success",
"data": [
{
"id": 1,
"name": "Feed Widget",
"icon": "ic:baseline-dynamic-feed",
"link": "/widget/customize-widget",
"status": "active",
"deleted_at": null,
"created_at": null,
"updated_at": null
}
],
"widget_add_ons": null
}
}Error payload
422 Location outside your tree
{
"message": "The selected store id does not belong to your company hierarchy.",
"errors": {
"store_id": [
"The selected store id does not belong to your company hierarchy."
]
}
}422 Location doesn't exist
{
"message": "The selected store id is invalid. (and 1 more error)",
"errors": {
"store_id": [
"The selected store id is invalid.",
"The selected store id does not belong to your company hierarchy."
]
}
}| Status | Meaning |
|---|---|
200 | The widget styles. |
401 | The token is missing, expired or invalid. |
422 | store_id or company_id doesn't exist or is outside your tree. |
500 | Unexpected server error. |
Example request
curl --request GET \
--url "https://production-api.shoutaboutus.com/api/v1/widget/type?store_id=3007" \
--header 'Authorization: Bearer <bearer-token>' \
--header 'Accept: application/json'Updated 17 days ago
Did this page help you?
