Theme API

Read Call

ListThemeBlocks1

List the blocks a shop's theme can use, with help, presets and where the shop uses them. By default only the blocks the shop uses.

Kind Read API call
Method GET or POST
URL https://app.bubblehouse.com/api/v2023061/<shop>/ListThemeBlocks1
Authentication Shop TokenStaff Token

Needs the theme view or theme edit permission. match filters block names, such as generic_banner_*. filter unconfigured lists the blocks the shop does not use; all both. Blocks are added to pages with update_configuration (config/theme/superblocks); their settings are read and changed with QueryThemeSettings1 and UpdateThemeSettings1.

Input

  • match string optional

    Return the keys matching this pattern, where * matches any text: banner.*, *.string, tier.*.hero.image.

  • filter string optional

    configured (the default) returns what is saved or in use; unconfigured what is not; all both. String lists also take translated and untranslated. unconfigured and all need the theme view permission.

  • cursor string optional

    Continue a list: pass next_cursor from the previous page.

  • limit integer optional

    Most items to return. Defaults to 200; at most 2000.

Output

  • blocks array of ThemeBlockDetails1 required

    The matching blocks in name order.

  • total integer required

    How many items matched, on all pages.

  • next_cursor string optional

    Set when more items follow; pass it as cursor to get them.

Usage Examples

Banner blocks the shop uses

Request

{
  "match": "generic_banner_*"
}

Response

{
  "blocks": [
    {
      "kind": "banner",
      "name": "generic_banner_textimage_1",
      "presets": [
        "dark"
      ],
      "settings": 42,
      "usages": [
        {
          "id": "hero-banner",
          "path": "hero-banner",
          "superblock": "rewards"
        }
      ]
    }
  ],
  "total": 1
}

Specific Errors

Status Error Reason & Examples
400 bad_data

An input is invalid.

403 access_denied

Your permissions do not allow this call.

Global Errors

Status Error Reason & Examples
401 invalid_token

The provided authentication token is invalid or has expired.

For example: The token has expired

Previous
ListShopStyles1