HTTP Post to Carbone.io API: Document get's created but data (works in postman)

Hello,
I’m building a workflow to generate pdfs with data pulled from Airtable.
To generate the PDFs we use https://carbone.io/

I can build the request with Postman or Insomnia.


When I build the request in n8n via the HTTP node, it also renders a the pdf template but without content:


Here is the data I’m sending:

      "id":42,
      "date":1492012745,
      "company":{
         "name":"Coca Cola",
         "address":"here",
         "city":"Notfar",
         "postalCode":123456
      },
      "customer":{
         "name":"myCustomer",
         "address":"there",
         "city":"Faraway",
         "postalCode":654321
      },
      "products":[
         {
            "name":"product 1",
            "priceUnit":0.1,
            "quantity":10,
            "priceTotal":1
         }
      ],
      "total":140
   }

Is there anything I’m doing wrong in the Body Parameters?

What’s a good way to debug this?

Thanks,
Chris

Okay, I posted the request to webhook.site and see the issue:
my data json is converted to string with escaped " and \n.

How can I avoid n8n doing that?

@chris can you share the expression in the data parameter?

Okay, I got it to work now following Extracting Data from Nested JSON

I’ve used the “Function Node”

Then wrote this expression:

And it creates now the content properly:

I hope I get how this works now :slight_smile:

1 Like