Templates¶
https://{cluster-id}.api.esales.apptus.cloud/api/admin/v4/export/templates
GET¶
An export of all templates in Elevate.
Request¶
curl -i \
-X GET \
-H 'Api-Key: pkA123456789AB1BE..' \
"https://{cluster-id}.api.esales.apptus.cloud/api/admin/v4/export/templates"
Response¶
Response codes¶
Status | Description |
---|---|
200 | Query accepted. The data will be returned as an application/json-object. |
403 | Incorrect cluster credentials. |
404 | Cluster not found. |
406 | No acceptable encoding found in Accept-Encoding header. |
500 | Server error such as cluster unavailable, busy or internal error. If 5xx errors persist, contact support and attach any information found in the response body. |
503 | The server in the cluster that received the request is currently unavailable or busy. It is recommended to retry the request. The time between request attempts should be increasing. |
Response body¶
Example
{
"templates" : {
"myTemplate" : {
"products" : {
"first" : {
"fields" : [ "brand", "title", "link", "sellingPrice", "listPrice", "inStock", "custom.material" ],
"variants" : {
"all" : {
"fields" : [ "label", "inStock", "sellingPrice", "listPrice", "custom.campaign" ]
}
}
},
"rest" : {
"fields" : [ "link", "swatch" ],
"maxVariants" : 0
}
}
}
}
}
Schema
TemplateBody¶
Name | Type | Description | Example |
---|---|---|---|
templates | <string, TemplateSettings> | Template definitions for response object customization. Template IDs must be alphanumeric and up to 25 characters. | {"myTemplate":{"products":{"first":{"fields":["brand","title","link","sellingPrice","listPrice","inStock","custom.material"],"variants":{"all":{"fields":["label","inStock","sellingPrice","listPrice","custom.campaign"]}}},"rest":{"fields":["link","swatch"],"maxVariants":0}}}} |
Schemas¶
Inner schemas
ProductTemplate¶
Name | Type | Description | Example |
---|---|---|---|
fields Required | string[] | The product level attributes to include. Custom attributes can be included by prefixing them with custom. , or the special custom.* can be used to include all custom attributes. | |
maxVariants | integer | The max number of variants to include. If not specified, all variants will be included. | 0 |
variants | TemplateMappingVariantTemplateSettingsVariantTemplate | The definition of the product's variants for either all or the first and rest of the variants. Required unless maxVariants is not set to 0. |
TemplateMappingProductTemplateSettingsProductTemplate¶
Name | Type | Description | Example |
---|---|---|---|
all | ProductTemplate | All products/variants. Only if first and rest are not used. | |
first | ProductTemplate | The first product/variant in the list. | |
rest | ProductTemplate | The remaining products/variants in the list. Required if first is used. |
TemplateMappingVariantTemplateSettingsVariantTemplate¶
Name | Type | Description | Example |
---|---|---|---|
all | VariantTemplate | All products/variants. Only if first and rest are not used. | |
first | VariantTemplate | The first product/variant in the list. | |
rest | VariantTemplate | The remaining products/variants in the list. Required if first is used. |
TemplateSettings¶
Name | Type | Description | Example |
---|---|---|---|
products Required | TemplateMappingProductTemplateSettingsProductTemplate | The definition of the group's products for either all or the first and rest of the products. |
VariantTemplate¶
Name | Type | Description | Example |
---|---|---|---|
fields Required | string[] | The variant level attributes to include. Custom attributes can be included by prefixing them with custom. , or the special custom.* can be used to include all custom attributes. |