Theme API
Read CallListThemeBlocks1
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
-
matchstring optionalReturn the keys matching this pattern, where
*matches any text:banner.*,*.string,tier.*.hero.image. -
filterstring optionalconfigured(the default) returns what is saved or in use;unconfiguredwhat is not;allboth. String lists also taketranslatedanduntranslated.unconfiguredandallneed the theme view permission. -
cursorstring optionalContinue a list: pass
next_cursorfrom the previous page. -
limitinteger optionalMost items to return. Defaults to 200; at most 2000.
Output
-
The matching blocks in name order.
-
totalinteger requiredHow many items matched, on all pages.
-
next_cursorstring optionalSet when more items follow; pass it as
cursorto 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: |