1. Home
  2. Extra
  3. Samba API
  4. Upload HTML template

Upload HTML template

Contents

This post is also available in: Czech

This API allows you to import HTML templates created outside the environment of Samba directly into the template store in your Samba account.
 

Endpoint URL

Depending on your account, select the appropriate endpoint URL.

  • If you are logging in at app.samba.ai –> choose the URL api.samba.ai
  • If you are logging in at enterprise.samba.ai –> choose the URL api.yottly.com

Your account ID can be found in the Settings section as part of your unique tracking script.

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 eshop
  • your-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 file
  • kindrecommender – 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

 

This post is also available in: Czech

Updated on April 11, 2023

Was this article helpful?

Related Articles