Aller au contenu principal

getAttributeSetByMarker

Obtenir un seul ensemble d'attributs par son marqueur.

Description​

Récupère un ensemble d'attributs par son marqueur, avec son schéma. Renvoie un IAttributeSetsEntity.

.getAttributeSetByMarker(

,

);

Schéma des paramètres​

Schéma

marker(required): string
Marqueur de l'ensemble d'attributs.
exemple : "productAttributes"

langCode: string
Code de langue. Par défaut : le langCode passé à defineOneEntry ("en_US" s'il n'y en a pas).
exemple : "en_US"

Exemples​

Exemple minimal​

const response = await AttributesSets.getAttributeSetByMarker('admins');

Exemple avec langCode​

const response = await AttributesSets.getAttributeSetByMarker('admins', 'en_US');

Exemple de réponse​

{
"id": 27,
"createdDate": "2025-10-28T13:50:27.426Z",
"updatedDate": "2025-02-26T17:18:11.275Z",
"version": 0,
"identifier": "admins",
"title": "Admins",
"schema": {
"admin-text": {
"id": 1,
"type": "string",
"original": true,
"isVisible": true,
"identifier": "admin-text",
"initialValue": null,
"localizeInfos": {
"title": "Admins text"
}
}
},
"isVisible": true,
"type": {
"id": 1,
"type": "forAdmins"
},
"position": 1
}

Schéma de réponse​

Schéma : IAttributeSetsEntity

id: number
ID de l'ensemble d'attributs.
exemple : 123

createdDate: string
Date de création de l'ensemble d'attributs.
exemple : "2023-10-01T12:00:00Z"

updatedDate: string
Date de la dernière mise à jour de l'ensemble d'attributs.
exemple : "2023-10-01T12:00:00Z"

version: number
Numéro de version de l'ensemble d'attributs ; change à chaque mise à jour.
exemple : 1

identifier: string
Marqueur de l'ensemble d'attributs.
exemple : "attributeSet1"

title: string
Nom de l'ensemble d'attributs.
exemple : "Product Attributes"

schema: Record<string, IAttributeSchemaItem>
Champs de schéma indexés par marqueur.
exemple :

{
"attribute1": {
"id": 1,
"type": "string",
"isPrice": false,
"original": true,
"identifier": "string",
"localizeInfos": {
"title": "String"
}
}
}

isVisible: boolean
Indique si l'ensemble d'attributs est visible.
exemple : true

type: IAttributeSetTypeRef
Type de l'ensemble d'attributs : un objet avec l'id et le nom du type.
exemple :

{ "id": 1, "type": "forProducts" }

type.id: number
Identifiant de type interne.
exemple : 1

type.type: string
Identifiant de type (par exemple "forAdmins", "forForms", "forProducts").
exemple : "forAdmins"

position: number
Position d'ordonnancement du jeu (place dans l'ordre sortBy=position) ; stable d'une requête à l'autre, ce n'est pas l'index dans le tableau renvoyé.
exemple : 1