Skip to content
Browse all functions

Render Carbone Template

carbone/rendercarbonetemplate

rendercarbonetemplate (Render Carbone Template) is a 1001fx API function in the group Carbone documents: POST https://api.1001fx.com/carbone/rendercarbonetemplate, 5 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

5 credits per callHTTP APIn8nMake

Fills the provided carbone template with data. This function uses the Carbone JS Community Edition on 1001fx servers.

Use cases

  • Fill a Word contract template with customer data and save it as PDF
  • Create Excel reports from a template and workflow data
  • Generate letters or certificates in bulk from one ODT template

Try it in the 1001fx app

Run rendercarbonetemplate in your browser with your API key – fill the form, click Run and get the answer or the file.

rendercarbonetemplate in the 1001fx app: the form with example values
Render Carbone Template in the 1001fx app

Endpoint

POSThttps://api.1001fx.com/carbone/rendercarbonetemplate
Header
X-API-KEY: YOURSECRETAPIKEY How to
Content type
multipart/form-data

Parameters

  • filefilerequired

    Template file to be processed.

  • dataobjectoptional

    Data to fill your template with. Either data or stringified data needs to be provided.

  • stringifiedDatastringoptional

    Stringified data to fill your template with.

    Example:
    {"companyName":"JohnInsurance & Co","period":2,"sD":1659041229,"id":2891,"insured":{"name":"Jean Michel","street":"23, Sycamore Street","city":"New York","phone":"+33 2 38 99 18 23"},"showPropertyDamage":false,"propertyDamage":[{"type":"Fire"},{"type":"Wind"},{"type":"Hail"},{"type":"Water"}],"options":[{"type":"Furniture","note":"/","cost":1200},{"type":"Appliances","note":"/","cost":400},{"type":"Clothing","note":"/","cost":300},{"type":"Dishes","note":"in some cases","cost":300}],"optionsTotalHT":2200,"optionsTaxes":10,"optionsTotal":2420}
  • outputFormatenumoptional

    Output format for your rendered template. Defaults to the format of the provided template.

    Values:
    pdf
    xslx
    docx
    ods
    csv
    txt
    odt
    Example:
    pdf

Examples

Render a TXT template

Fills carbonetemplate.txt with the JSON data and returns the rendered file.

Input

Expects a .txt template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.txt",
      "type": "",
      "path": "testdata/carbonetemplate.txt"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "text/plain"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.txt'

Render an XLSX template

Fills carbonetemplate.xlsx with the JSON data and returns the rendered file.

Input

Expects a .xslx template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.xlsx",
      "type": "",
      "path": "testdata/carbonetemplate.xlsx"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.xlsx'

Render a DOCX template

Fills carbonetemplate.docx with the JSON data and returns the rendered file.

Input

Expects a .docx template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.docx",
      "type": "",
      "path": "testdata/carbonetemplate.docx"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.docx'

Render an HTML template

Fills carbonetemplate.html with the JSON data and returns the rendered file.

Input

Expects a .html template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.html",
      "type": "",
      "path": "testdata/carbonetemplate.html"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "application/xhtml+xml"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.html'

Render an ODT template

Fills carbonetemplate.odt with the JSON data and returns the rendered file.

Input

Expects a .odt template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.odt",
      "type": "",
      "path": "testdata/carbonetemplate.odt"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "application/vnd.oasis.opendocument.text"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.odt'

Render an XML template

Fills carbonetemplate.xml with the JSON data and returns the rendered file.

Input

Expects a .xml template and data as parameters
{
  "files": [
    {
      "name": "carbonetemplate.xml",
      "type": "",
      "path": "testdata/carbonetemplate.xml"
    }
  ]
}

Output · HTTP 200

Result is a single file.
{
  "statusCode": 200,
  "headers": {
    "content-type": "application/xml"
  }
}
Show curl command
curl -X POST 'https://api.1001fx.com/carbone/rendercarbonetemplate' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -F 'file=@carbonetemplate.xml'

Frequently asked questions

Which template formats can I use?
Carbone templates such as DOCX, XLSX, ODT, TXT, HTML and XML. The output can be converted with outputFormat, for example to PDF; without it the format of the template is kept.
How do I pass the data?
As JSON object in data or as a JSON string in stringifiedData. One of the two is required.
Is the template sent to Carbone Cloud?
No. This function uses the Carbone JS Community Edition on the 1001fx servers. For templates stored in Carbone Cloud use rendercarbonecloudtemplate.

Try rendercarbonetemplate now

Run it in your browser or create a free account and get 100 credits every month.

Changelog

  • 1.0.013.04.2023created
Ask 1001fx