Import HTML

Learn more about using the HTML Importer API endpoint.

Overview

This page discusses how to use the HTML Importer API endpoint. Follow the instructions outlined in this page to successfully perform API calls.

Important: Ensure you complete the Authentication steps and obtain your API key prior to performing the steps on this page.

Prerequisites

Prior to performing an API call, ensure the HTML you are using in the body of the POST request meets the following requirements:

  • DOCTYPE declaration

  • Include html and body elements

  • To prevent character encoding issues during the conversion, include the <meta charset="UTF-8"> tag in the head section of your HTML before converting it.

Steps to perform the API call

Take the following steps to perform the conversion:

  1. Ensure your API method is set to POST

  2. Enter the endpoint URL: https://api.getbee.io/v1/conversion/html-to-json

    • Note: You can do this by setting {collection} equal to conversion in the following url: https://api.getbee.io/v1/{collection}/html-to-json

  3. Authenticate by entering your API key as a Bearer Token in the Auth Type field

  4. Ensure your request body's Content-Type is set to text/html

  5. Paste the HTML you'd like to convert into the request body field and ensure it meets the requirements outlined in the Prerequisites section

  6. Click Send

Within a few seconds, you should receive a response containing the Beefree JSON.

Note: If your imported HTML contains inline CSS, it will be converted as long as the HTML structure is valid. The importer converts from HTML to Beefree JSON but does not enhance or add new styles — only what's present in the source HTML will be mapped.

Test the endpoint here

You can test the endpoint in the following interactive environment. Ensure you follow the steps outlined in the Steps to perform the API call section to successfully execute the API call after clicking the Test it button. You can copy and paste the HTML in the Sample HTML Template to Convert expandable section below, or use your own HTML as a request body for experimenting with the Test it feature.

Sample HTML Template to Convert

You can use the following template if you'd like to test a conversion now:

HTML Importer

post

The HTML Importer API is an API built to easily convert HTML email templates into Beefree's JSON format.

Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
collectionstringRequired

The collection ID or name

Body
stringOptional
Responses
200

Successful response

application/json
Responseobject
post
/v1/{collection}/html-to-json

Last updated

Was this helpful?