searchBlock
Recherche rapide d'objets de bloc avec une sortie limitée.
Description
Blocks.searchBlock(
name*,
langCode
);
Schéma des paramètres
Schéma
name(required): string
Chaîne de recherche
exemple : "product_block"
langCode: string
Code de langue. Par défaut : "en_US"
exemple : "en_US"
Exemples
Exemple minimal
const response = await Blocks.searchBlock('my-marker');
Exemple avec des attributs
const response = await Blocks.searchBlock('my-marker', 'en_US');
Exemple de réponse
[
{
"id": 5,
"identifier": "another",
"name": "another"
},
{
"id": 2,
"identifier": "similar",
"name": "similar"
}
]
Schéma de réponse
Schéma : ISearchBlock[]
id: number
Identifiant unique du bloc de recherche.
exemple : 1
identifier: string
Identifiant unique sous forme de chaîne pour le bloc de recherche.
exemple : "search_block_1"
name: string
Nom du bloc de recherche.
exemple : "Search Block 1"