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

EnvironmentURL
Productionhttps://production-api.shoutaboutus.com
Developmenthttps://development-api.shoutaboutus.com

Endpoint

GET /api/v1/widget/type

Authentication

Partner or Account token

  • store_id and company_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

ParameterInTypeRequiredDescription
store_idqueryintegerNoA 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_idqueryintegerNoAn 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.

FieldTypeDescription
statusstringsuccess.
dataarray of objectsThe active widget styles.
data[].idintegerThe style's id. Use it as widget_type_id in Create or update a widget.
data[].namestringThe style's name.
data[].iconstring or nullThe style's icon name.
data[].linkstring or nullThe style's page path in the app.
data[].statusstringactive.
data[].deleted_atstring or nullAlways null: deleted styles aren't listed.
data[].created_atstring or nullWhen the style was added, if recorded.
data[].updated_atstring or nullWhen the style was last changed, if recorded.
widget_add_onsobject or nullThe widget add-on check for store_id. null when store_id isn't sent.
widget_add_ons.statusbooleanWhether the location has an active widget add-on.
widget_add_ons.store_idsarray of integers or nullThe 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."
    ]
  }
}
StatusMeaning
200The widget styles.
401The token is missing, expired or invalid.
422store_id or company_id doesn't exist or is outside your tree.
500Unexpected 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'

Did this page help you?