Search code examples
power-automateconvertapi

ConvertAPI Response Object formatting


I am currently using Power Automate in order to transform DOCX documents into HTML documents. The integration with the convertAPI came as easy as possible, but I wonder if there is a way to receive the response of the convertAPI and have the CSS Styles in a seperate object. Current received Response is in the below format:

{
  "ConversionCost": 2,
  "Files": [
    {
      "FileName": "How to use this handbook.html",
      "FileExt": "html",
      "FileSize": 114295,
      "FileData": "<base64 encoded content>"
    }
  ]
}

I was wondering if I could get it in the below format:

{
  "ConversionCost": 2,
  "Files": [
    {
      "FileName": "How to use this handbook.html",
      "FileExt": "html",
      "FileSize": 114295,
      "FileData": "<base64 encoded content>",
      "<CSS Data>": "<base64 encoded content>"
    }
  ]
}

Solution

  • Currently we do not provide such option. However, you can post-process the converted HTML using some open source tools to extract the CSS from HTML, for example: https://github.com/adnantopal/extractcss.