Skip to main content

getTemplateByMarker

Getting one template object by marker.

Description

This method retrieves a single template object based on its identifier (marker) from the API. It returns a Promise that resolves to a template object ITemplateEntity.

Templates.getTemplateByMarker(

marker, langCode

);

Parameters schema

Schema

marker(required): string
The unique marker of the template to retrieve
example: "template_12345"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

const response = await Templates.getTemplateByMarker('my-marker');

Example with langCode attribute

const response = await Templates.getTemplateByMarker('my-marker', 'en_US');

Example response

{
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}

Response schema

Schema: ITemplateEntity

id: number
The unique identifier of the position.
example: 12345

attributeSetIdentifier: string | null
Set of attributes id.
example: "attribute_set_1"

title: string
The name of the template.
example: "Product Template"

generalTypeId: number
General type Entity id.
example: 67890

identifier: string
The textual identifier for the record field.
example: "template_12345"

version: number
The version number of the object.
example: 1

generalTypeName: Types
General type name.
example:

"product"

attributeValues: AttributeType
Attribute values from the index (represented as a pair of user attribute id: attribute value).

position: number
The position of the object.
example: NaN