The Content Services API Reference provides a comprehensive guide to utilizing the Content Services API, which leverages the REST architecture and HTTP protocol for making API calls. This reference document outlines the available collections, including /message
, /page
, /popup
, /amp
, /template
, and /ai
, detailing the resources for each collection. For every resource, this document includes its description, parameters, and example responses and requests.
To use the Content Services API you will first need to obtain a your API Key from the Beefree SDK Console.
To obtain an API Key, take the following steps:
Log into the Beefree SDK Console
Locate the application that you wish to work with, and click on Details
Locate the Content Services API section and click Create New API Key
Acknowledge the message that reminds you that if you exceed the number of API calls included in your plan, you may be charged for overages and click Create Key
Your API key will appear under the Content services API section of your application details.
The Content Services API uses API Keys to authenticate requests for resources. You can manage your API Keys within the Beefree SDK Console. All requests must be made over HTTPS and contain the following HTTP Header:
Authorization:
Bearer {token}
API requests rate limits exist independently of API key’s monthly usage allowance.
By default, the API has the following rate limits:
Per minute: 500 requests
Per second: 100 requests
X-Rate-Limit: An integer representing the total number of requests available per cycle. Exceeding the limit per cycle results in a 429 error. (e.g. 500)
X-Rate-Limit-Remaining: An integer representing the number of remaining requests before the next cycle begins, and the count resets. (e.g. 100)
X-Rate-Limit-Reset: A Unix timestamp representing the time the next cycle will begin, and the count will reset.
Retry-After: A Unix timestamp representing the time the application may resume submitting requests.
All API access is over HTTPS, and accessed from the following URL:
https://api.getbee.io/v1/{collection}/{resource}
The following table lists the available collection option and corresponding resources for each collection.
The following table provides a few examples of URLs you can use to make specific types of requests.
The following section provides detailed information for each of the resources associated with each collection mentioned in the previous section.
URL: https://api.getbee.io/v1/{collection}/html
Endpoint: /message/plain-text
URL: https://api.getbee.io/v1/{collection}/pdf
Note: The response is a JSON string that will contain the URL of the temporary location of the PDF document. The file is available for 24 hours.
URL: https://api.getbee.io/v1/{collection}/image
URL: https://api.getbee.io/v1/{collection}/merge
URL: https://api.getbee.io/v1/{collection}/merge-rows
When utilizing this feature, it's important to consider adding a handle to the metadata. This handle serves a crucial role in functions such as onDeleteRow
and onEditRow
. In our provided example, we use a handle named guid
. However, users have the flexibility to choose their own handle name according to their preferences and requirements. When selecting a handle name, we recommend you choose something descriptive and meaningful for ease of identification and management within your workflow.
URL: https://api.getbee.io/v1/{collection}/synced-rows
URL: https://api.getbee.io/v1/{collection}/merge/index
The resources in the AI collection accept your template JSON and use generative AI to return text within a JSON object to you.
Prior to getting started with the resources in this collection, ensure you have the following:
Superpowers subscription or higher
OpenAI AddOn installed and configured in your Beefree Developer Console
Content Services API key
Note: OpenAI billing costs apply in addition to the Content Services API billing.
v1/ai/metadata
v1/ai/sms
v1/ai/summary
Collection | Available Resources |
---|---|
Type | Action | Example URL |
---|---|---|
/message
html
, pdf
, images
, merge
, index, plain-text
/page
html
, pdf
, images
, merge
, index
/popup
html
/amp
html
/template
brand
/ai
metadata
, sms
, summary
Request HTML for email
https://api.getbee.io/v1/message/html
Landing Page
Request HTML for a landing page
https://api.getbee.io/v1/page/html
Popup
Request HTML for a popup
https://api.getbee.io/v1/popup/html
AMP
Request HTML for AMP
https://api.getbee.io/v1/amp/html
The Merge Rows endpoint enables you to integrate custom fonts and resized images into your designs. It saves custom fonts within the template's JSON, ensuring the correct font is displayed. It also handles image resizing, particularly when the image's initial template width is narrower than the saved row's destination template. To use this endpoint, send your template and rows in JSON format. You will receive a response with an updated template. The rows requiring an update are identified by their rowIdentifier values.
The collection ID or name
JSON payload with the template and rows
Label for identifying rows, usually GUID
An array of Beefree rows in JSON format
HTML and styling for paragraphs
A Beefree template in JSON format
List of available webfonts to rectify missing ones
Updated template with merged rows
Transform HTML and image settings into an image.
The collection ID or name
JSON payload with HTML message and image settings
Accepts jpg or png
The image height in pixels
A BeeFree HTML message
Image size if width and height are not defined
The image width in pixels
The image response as a binary data in PNG format
This endpoint accepts a JSON template to create a plain text version of an email.
Parameters required to generate plain text from a template.
Optional. The output language for multi-language templates.
The template's JSON used to create the plain text document.
Array of row definitions inside the template.
Metadata for the template.
A successful response with the plain text document.
Transform a JSON template into an HTML response.
The collection ID or name
JSON payload with the template
Flag to return beautified HTML
For multi-language templates, sets the output language using a valid language code
A BeeFree template in JSON format
The main structure of the template page
Defines the style and structure of the container for the page.
The CSS style attributes for the container.
Background color in hexadecimal or other CSS color formats.
"#FFFFFF"
Content and styling for the page.
Contains computed styles for different elements on the page.
Color of the link.
"#FF819C"
Background color of the message.
"transparent"
The width of the message area.
"675px"
General styling for text and fonts.
Font color.
"#000000"
Font family.
"Arial, Helvetica Neue, Helvetica, sans-serif"
List of external web fonts used in the template.
The font-family definition for the web font.
"'Montserrat', 'Trebuchet MS', 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', Tahoma, sans-serif"
Name of the web font.
"Montserrat"
The URL to the web font.
"https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap"
A description of the template.
"BF-ecommerce-template"
Contains all the rows in the page layout.
Defines the columns in each row.
Number of grid columns in the row.
6
Content modules within the column.
Descriptor for module styles and attributes.
Computed styles specific to this module.
CSS class for the module.
"left fixedwidth"
Width of the module.
"287px"
Image properties.
Alternative text for the image.
"Image"
Height of the image.
"142px"
Hyperlink for the image.
"https://beefree.io"
Source URL of the image.
"https://ih1.redbubble.net/image.4902607927.7016/flat,750x,075,f-pad,750x1000,f8f8f8.jpg"
Width of the image.
"546px"
Template name.
"template-base"
Template type.
"basic"
Template version.
"2.0.0"
Title of the template.
"BF-ecommerce-template"
The HTML response
This endpoint accepts HTML and settings to generate a PDF document and provides a URL for the PDF.
Parameters required to generate a PDF from HTML.
The file type for the output.
A full HTML document to be transformed into a PDF.
The orientation of the PDF page.
The size of the PDF page.
A successful response with the PDF document URL.
The MIME type of the PDF file.
The filename of the generated PDF.
The orientation of the PDF.
The size of the generated PDF.
The URL where the generated PDF is temporarily hosted.
The HTTP status code of the response.
Replace or update content in the template using a specific path and value.
JSON path of the element to replace.
"$..rows[?(@.metadata.uid=='508824c4-8d45-11ee-84be-aafd6b2aca16')]"
The new value that will replace the current content.
4
Computed style for the module.
Image details and properties.
Paragraph details and properties.
"mailup-bee-newsletter-modules-paragraph"
Style attributes for the column.
"transparent"
Styling and metadata for the container.
Conditions for showing the content.
Content metadata and styling.
Metadata for the updated content.
"508824c4-8d45-11ee-84be-aafd6b2aca16"
""
Successful operation
The transformed HTML output.
The resulting updated JSON structure.
The page content and structure.
The body of the page.
Comments associated with the operation.
Retrieve a list of synced rows from a template.
The collection name.
Parameters for the synced rows request.
The label used for identifying the rows added to the metadata key, usually GUID.
The JSON structure of the template.
"#ffffff"
"#7747FF"
"transparent"
"600px"
"#000000"
"Arial, Helvetica, sans-serif"
"<p>I'm a new paragraph block.</p>"
"#101112"
"'Alegreya', 'Trebuchet MS', Helvetica, sans-serif"
"16px"
"0922fb70-f97e-4ae8-bcfe-0be9fd09a0d5"
true
"'Alegreya', 'Trebuchet MS', Helvetica, sans-serif"
"Alegreya"
"https://fonts.googleapis.com/css2?family=Alegreya:wght@100;200;300;400;500;600;700;800;900"
A successful response with a list of synced rows.
The unique identifier for the row, typically a GUID.
"0922fb70-f97e-4ae8-bcfe-0be9fd09a0d5"
The index of the row inside the template.
0
Reference an array of metadata objects from a Beefree template in JSON format.
The collection ID or name
JSON payload containing the Beefree template
A Beefree template in JSON format
An array of metadata objects containing row details
This endpoint accepts a JSON template and options to generate a custom SMS.
"gpt-3.5-turbo"
Specify the tone of voice for the SMS.
"detailed"
Extra instructions for the AI.
true
"it-IT"
"#fff"
"none"
"top left"
"no-repeat"
"auto"
Successful response with SMS.
"Ciao! Ti interessa partecipare a un progetto di ricerca utente con noi? Sarà una videochiamata di 30-45 minuti."
475
87
562
This endpoint accepts a JSON template and options to generate a concise summary.
"gpt-3.5-turbo"
Specify the tone of voice for the summary.
"concise"
Extra instructions for the AI.
true
"it-IT"
"#fff"
"none"
"top left"
"no-repeat"
"auto"
Successful response with summary.
"Vuoi partecipare a un progetto di ricerca utente con BEE Pro? Rispondi a Dalila per prenotare un colloquio video."
425
39
464
The endpoint accepts a JSON template and returns a JSON object with metadata.
JSON template and options to generate metadata
Optional settings that provide additional instructions to the AI for metadata generation.
The model to be used for the AI, such as GPT-3.5-turbo.
"gpt-3.5-turbo"
Defines the tone of voice for the generated metadata, e.g., 'Formal', 'Humorous'.
""
Additional instructions to the AI for metadata generation.
"Try to use a pun."
Boolean flag to request usage data from the AI.
true
Specify the output language using a valid language code.
""
A JSON object representing the template structure.
The main content structure of the template.
The body of the template, including container and content styles.
Contains style information for the main container of the template.
CSS properties for the container.
"#fff"
"none"
"top left"
"no-repeat"
"auto"
Contains computed styles and the main content styles.
Computed styles for elements within the content.
"#8a3b8f"
"transparent"
"650px"
General style attributes for the content.
"#000000"
"Lato, Tahoma, Verdana, Segoe, sans-serif"
Template type used for identification.
"mailup-bee-page-properties"
List of web fonts used in the template.
"'Lato', Tahoma, Verdana, Segoe, sans-serif"
"Lato"
URL to fetch the font.
"https://fonts.googleapis.com/css?family=Lato"
Basic information about the template.
"template-base"
"basic"
"2.0.0"
Title of the template.
""
Brief description of the template.
""
Array of row objects that define the layout of the template.
Defines the grid layout within the row.
Number of grid columns used.
12
Content modules within the column.
Module descriptor including styles and attributes.
"center"
"10px"
"5px"
A JSON object with metadata (preheader and subject).
Preheader text for the email.
"Ready to Bee a part of our user research project? Schedule your interview now!"
Subject line for the email.
"BEE Pro: Let's Bee-gin! Join our user research project 🐝"
Information about the token usage in the AI request.
424
48
472
Detailed information on completion token usage.
0