# Bannerbear

Bannerbear in ZBrain Flow is a powerful platform that automates image generation with AI. It allows you to create dynamic, on-demand visuals from pre-defined templates, making it easy to generate personalized images for marketing campaigns, social media posts, or product listings—all without manual design work.

#### **How to Integrate Bannerbear with ZBrain Flow** <a href="#how-to-integrate-bannerbear-with-zbrain-flow" id="how-to-integrate-bannerbear-with-zbrain-flow"></a>

1. **Click the “+” Button in the Flow**\
   Open your ZBrain Flow and select the plus sign (**+**) to add a new step.
2. **Search for “Bannerbear”**\
   Type **“Bannerbear”** in the search bar to view the available tasks.
3. **Choose the Desired Task**\
   Select the **Create Image** or **Custom API Call** action, depending on your workflow requirements.

#### **Tasks You Can Perform on Bannerbear** <a href="#tasks-you-can-perform-on-bannerbear" id="tasks-you-can-perform-on-bannerbear"></a>

* **Create Image**\
  Generate a new image based on a Bannerbear template. You can map dynamic data (like text, images, or color values) from previous steps to populate template fields.
* **Custom API Call**\
  Make a tailored API request to Bannerbear’s endpoints for more advanced use cases. This provides flexibility to access or modify Bannerbear data beyond the standard actions.

#### **Create Image**   <a href="#create-image" id="create-image"></a>

Generate a new image based on a Bannerbear template. You can map dynamic data (like text, images, or color values) from previous steps to populate template fields.

#### **How to Configure the “Create Image” Action with Bannerbear in ZBrain Flow?** <a href="#how-to-configure-the-create-image-action-with-bannerbear-in-zbrain-flow" id="how-to-configure-the-create-image-action-with-bannerbear-in-zbrain-flow"></a>

**Step 1: Add the “Create Image” Step**

1. **Insert a New Step**
   * In your flow, click the **+** button to add a new step.
2. **Search for “Bannerbear”**
   * Type “Bannerbear” in the search bar and select **Create Image** from the available actions.

**Step 2: Create a Bannerbear Connection**

1. Under **API Key**, choose the Bannerbear connection or **Create a new connection**.
   * **Name Your Connection**
     * Enter a recognizable name (e.g., “Bannerbear”).
   * **API Key**
     * Paste your **Bannerbear API Key**, which you can obtain from your Bannerbear account.
   * **Save the Connection**
     * Click **Save** to finalize. Your new Bannerbear connection is now ready to use.

**Step 3: Configure the “Create Image” Action**

1. **Template**
   * Enter the **Template ID** from your Bannerbear dashboard. This corresponds to the specific template you want to use for image generation.
2. **Template Version** (Optional)
   * Specify which version of the template you’d like to render. If left blank, Bannerbear defaults to the latest version.
3. **Transparent Background** (Toggle)
   * Enable this if you need the generated image to have a transparent background.
4. **Render or PDF** (Toggle)
   * Switch between **PNG** or **PDF** output. If you need a PDF version, enable this toggle.
5. **Metadata** (Optional)
   * Provide additional metadata for advanced use cases. This can include custom fields or tracking information you want associated with the generated image.

**Step 4: Save and Test**

1. **Save Your Configuration**
   * Once you’ve specified all necessary details, click **Save** or **Done** to confirm.
2. **Run the Flow**
   * Test your flow to verify that the “Create Image” step communicates properly with Bannerbear.
3. **Check the Output**
   * Review the generated image link or PDF URL in the flow’s output to ensure the final design matches your expectations.

#### **Custom API Call**   <a href="#custom-api-call" id="custom-api-call"></a>

Make a tailored API request to Bannerbear’s endpoints for more advanced use cases. This provides flexibility to access or modify Bannerbear data beyond the standard actions.

#### **How to Configure the “Custom API Call” Action with Bannerbear in ZBrain Flow?** <a href="#how-to-configure-the-custom-api-call-action-with-bannerbear-in-zbrain-flow" id="how-to-configure-the-custom-api-call-action-with-bannerbear-in-zbrain-flow"></a>

**Step 1: Add the “Custom API Call” Step**

1. **Insert a New Step**
   * In your ZBrain Flow, click the **+** button to add a new step.
2. **Search for “Bannerbear”**
   * Type **“Bannerbear”** in the search bar and select **Custom API Call** from the available options.

**Step 2: Create a Bannerbear Connection**

1. Under **API Key**, choose the Bannerbear connection or **Create a new connection**.
   * **Name Your Connection**
     * Enter a recognizable name (e.g., “Bannerbear”).
   * **API Key**
     * Paste your **Bannerbear API Key**, which you can obtain from your Bannerbear account.
   * **Save the Connection**
     * Click **Save** to finalize. Your new Bannerbear connection is now ready to use.

* **Use the Existing Connection**

If you’ve previously created a Bannerbear connection, you can select it directly in the **API Key** dropdown within the “Custom API Call” step.

**Step 3: Configure the Request Details**

1. **URL**
   * Enter the **Bannerbear API endpoint** you wish to call (e.g., `https://sync.api.bannerbear.com/v2/images`).
2. **Method**
   * Choose the **HTTP method** (e.g., GET, POST, PUT, DELETE) based on the Bannerbear endpoint you want to interact with.
3. **Headers**
   * The **Authorization** header (with your API key) will typically be added automatically once you select your Bannerbear connection.
   * Add any additional headers if required by the specific Bannerbear endpoint.
4. **Query Parameters** (Optional)
   * If the endpoint requires query parameters, click **Add Item** under **Query Parameters** and fill in the key-value pairs.
5. **Body** (Optional or Required)
   * Provide the **JSON body** in the **Body** field for POST or PUT requests.
   * Include fields like `template`, `modifications`, or other data as needed by the Bannerbear API documentation.
6. **No Error on Failure** (Toggle)
   * Enable this if you want the flow to continue even if the API call returns an error.
7. **Timeout (in seconds)** (Optional)
   * Specify how long the step should wait before timing out. If left blank, a default timeout is used.

**Step 4. Save and Test**

1. **Save the Step**
   * Once you’ve filled in the required details, click **Save** or **Done** to confirm.
2. **Run the Flow**
   * Test your flow to ensure the “Custom API Call” communicates correctly with Bannerbear.
3. **Check the Output**
   * Inspect the output to verify that the API call returned the expected result.
   * If the response doesn’t match your expectations, adjust the endpoint, request body, or headers as needed.
