This post is also available in:

This API allows you to import HTML templates created outside the environment of Samba directly into the template store in your Samba account.
POST
https://api.samba.ai/shop/samba-id/upload-html-template
header: 'X-Api-Key: your-api-key'
body: {name: "template-name", kind: "kind", recommender: "recommender", template-body: "html-file"}
samba-id– Samba ID of your eshopyour-api-key– Samba API key for your eshop (Please ask us for the API key via email)template-name– the name of the template in Samba. Existing template will be overwritten.html-file– a valid *.html filekind, recommender– one of the following combination according to the type of your email template (see details here)
| Template type | kind | recommender |
| Static | standard |
staticRecommender |
| Personalised | standard |
productsRecommenderNoCategories |
| Abandoned Cart Trigger | cart |
cart |
| Shopping Intention Trigger | zsv |
zsv |
| Right Before Consumption Trigger | fmcg |
fmcg |
Response
{
status: success | failure,
message: string, //optional
details: [ { line: int, column: int, message: string } ] //optional
}
Example
jq -c -s -R '{name: "TEMPLATE_NAME", kind: "standard",
recommender: "staticRecommender", "template-body": .}' < TEMPLATE.html | \
curl -H 'X-Api-Key: YOUR_API_KEY' -d @-
https://api.samba.ai/shop/123456789/upload-html-template