Content Services API Reference
Last updated
Was this helpful?
Last updated
Was this helpful?
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.
/message
html
, pdf
, images
, merge
, index, plain-text
/page
html
, pdf
, images
, merge
, index
/popup
html
/amp
html
/template
brand
/ai
metadata
, sms
, summary
The following table provides a few examples of URLs you can use to make specific types of requests.
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 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
This endpoint accepts a JSON template to create a plain text version of an email.
/v1/message/plain-text
Optional. The output language for multi-language templates.
The template's JSON used to create the plain text document.
This endpoint accepts HTML and settings to generate a PDF document and provides a URL for the PDF.
/v1/{collection}/pdf
A full HTML document to be transformed into a PDF.
The file type for the output.
PDF
The orientation of the PDF page.
landscape
, portrait
The size of the PDF page.
letter
, A4
, A3
, Full
Transform HTML and image settings into an image.
/v1/{collection}/image
The collection ID or name
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
Transform a JSON template into an HTML response.
/v1/{collection}/html
The collection ID or name
Flag to return beautified HTML
For multi-language templates, sets the output language using a valid language code
A BeeFree template in JSON format
Reference an array of metadata objects from a Beefree template in JSON format.
/v1/{collection}/merge/index
The collection ID or name
A Beefree template in JSON format
Retrieve a list of synced rows from a template.
/v1/{collection}/synced-rows
The collection name.
The label used for identifying the rows added to the metadata key, usually GUID.
The JSON structure of the template.
The endpoint accepts a JSON template and returns a JSON object with metadata.
/v1/ai/metadata
Optional settings that provide additional instructions to the AI for metadata generation.
A JSON object representing the template structure.
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.
/v1/{collection}/merge-rows
The collection ID or name
Label for identifying rows, usually GUID
A Beefree template in JSON format
List of available webfonts to rectify missing ones
An array of Beefree rows in JSON format