Questions? Feedback? powered by Olark live chat software

Newsman API Page

Newsman API » Newsman API 1.0 » Template » template.render

Newsman Api Method: template.render

Prototype: template.render($key, $account_id, $template_id, $template_engine, $params)

Description: Renders a template, using the specified template engine and parameters, for this account

Return: struct (Returns dictionary with the rendered HTML code in the key: content)

Variable Type Description
$key string API key
$account_id string
$template_id string the template identifier
$template_engine string the templating engine – eg: handlebars
$params array the parameters to be used when rendering the template through the template engine

Curl Code Example

curl -H "Content-Type: application/json" -X POST -d @test_call.json https://cluster.newsmanapp.com/api/1.0/template.render
 
{
  "key": "your_api_key",
  "account_id": "your_account_id",  
  "template_id", "the_template_id",
  "template_engine": "handlebars",
  "params": {
      "company": "ACME",
      "country": "USA",
      "products": [
      	{"name": "The test product", "price": 50, "currency": "USD"},
      	{"name": "The second product", "price": 25, "currency": "EUR"}
      ]
  }   
}