# 3rd Party APIs

## Guidance Video

{% embed url="<https://youtu.be/tX6LNIlc8lg?feature=shared>" %}

## APIs Management

The **APIs Management** section allows you to add, configure, test, and manage all third-party APIs that can be used inside your chatbot flows.

You can use these APIs to:

* Send data to external systems
* Fetch customer details
* Trigger third-party actions
* Automate workflows after bot interactions

***

### How to Access APIs Management

1. Go to **More** from the left sidebar.
2. Click on **3rd Party APIs**.
3. You will land on the **APIs Management** page.

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2FCsSSwKuTLNdVKcigQvz3%2Fimage.png?alt=media&#x26;token=e5451910-862b-4344-bc13-bae9899cd0c3" alt=""><figcaption></figcaption></figure>

***

### Overview of the APIs Management Page

#### 🔎 Search Bar

* Use **Search by API name** to quickly find a configured API.

#### ➕ Add API

* Click **Add API** (top right) to create a new API configuration.

#### 📋 API List Table

The table displays all configured APIs with the following details:

| Column   | Description                           |
| -------- | ------------------------------------- |
| API Name | Name given to the API                 |
| Method   | Request type (GET, POST, PUT, DELETE) |
| URL      | Configured API endpoint               |
| Actions  | Edit (⚙️) or Delete (🗑️) the API     |

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2FR9TdHMnqX1VhFYPaLgij%2Fimage.png?alt=media&#x26;token=c9c1d7e4-fd80-4c8f-92e4-dfed25f18e58" alt=""><figcaption></figcaption></figure>

***

### Managing an Existing API

#### ⚙️ Edit API

* Click the **Settings (⚙️) icon** to modify:
  * API URL
  * Headers
  * Parameters
  * Body
  * Response mapping

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2Fat1UkerS1pIw2Y8GIxCo%2Fimage.png?alt=media&#x26;token=ab7cbb95-44f3-4708-a1d8-14c8220b6c42" alt=""><figcaption></figcaption></figure>

#### 🗑️ Delete API

* Click the **Delete (🗑️) icon** will show the warning popup.
* Confirming will permanently delete the API.

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2FX0OOD00IOL3uSE1f92ZJ%2Fimage.png?alt=media&#x26;token=9ec0011e-1fd6-47ce-95a4-2a6b3373225a" alt=""><figcaption></figcaption></figure>

> ⚠️ Note: Deleting an API may impact any chatbot flow where it is currently used.

***

## Setting up API's in BotPenguin

1. Login to your [**BotPenguin Dashboard**](https://app.botpenguin.com/)**.**
2. Go to the **More** section from the sidebar.
3. Click on the **3rd Party API** option.
4. Click on **“Add API”** to add a new API.

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2FYhpTFGEy0Zss0SqiChsi%2Fimage.png?alt=media&#x26;token=2e74c18d-c972-43d9-a05f-65c120189c7d" alt=""><figcaption></figcaption></figure>

***

### Configure 3rd Party API

The **Configure API** section allows you to integrate external APIs with your bot to send or fetch data dynamically during conversations.

#### a. Basic Configuration

1. Go to **More** from the left sidebar.
2. Click on **3rd Party APIs**.
3. Select **Configure API**.

Now fill in:

* **API Name** – Enter a unique name for the API.
* **Method Type** – Choose from:
  * GET
  * POST
  * PUT
  * DELETE
* **API URL** – Enter the complete endpoint URL.
* **Description** – (Optional) Add internal notes about what this API does.

Click **Test** to check the API response before saving.

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2F4OJsyTtQ6MDFarwtIc6V%2Fimage.png?alt=media&#x26;token=25ea652c-d10b-4c8f-bdc8-75b5e264ed21" alt=""><figcaption></figcaption></figure>

#### b. Configure Request Details

1. **Parameters Tab**
   1. Add **Key–Value** pairs for query parameters.
   2. Click **Add another field** to add more parameters.
2. **Headers Tab**
   1. Add required headers (e.g., Authorization, Content-Type).
3. **Body Tab**
   1. Required for POST/PUT requests.
   2. Add JSON or form data based on API requirements.

***

#### c. Manage API Responses

Use **Manage API responses** to:

* Map response fields
* Save API responses
* Use values inside chatbot flows
* Trigger conditional logic

***

#### d. Third Party Integration

Configure how this API connects with:

* Chatbot flows
* AI Agents
* Live Chat automation

***

#### e. Final Step

Click **Save** after successful testing.

***

#### Manage API Responses

1. Once the API is tested, you can **map API responses to custom attributes**.
2. Example: Map the API’s `title` field to a chatbot’s custom attribute.
3. These attributes can then be reused later in the conversation flow.

***

#### Use API in Chatbot Flow

1. Create a new flow (e.g., *Products Test*).
2. Add default or custom **questions** to capture user inputs.
3. Open the **Request Information Tab** and select the **API Component**.
4. Choose the API you created earlier.
5. Set up response handling:
   * **Success (200 status code):** Redirect user to success message or next step.
   * **Failure (4xx codes):** Redirect user to a fallback message.
   * **Server Errors (5xx codes):** Redirect to another prompt (e.g., *How was your day?*).

***

#### Testing & API Logs

1. Test your API flow using **“Test Live on WhatsApp Web”**.
2. Navigate to **More → third party APIs → select your API → API Logs → Click on view**&#x20;
3. Here, you can check:
   * API call history
   * Response codes (200, 400, 500, etc.)
   * Errors and reasons for failure
   * Actions - copy and delete

<figure><img src="https://1745791824-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAPDb8cKQtGlIAfgHjcsQ%2Fuploads%2Fttztld3JMR5oXm5g8OuY%2Fimage.png?alt=media&#x26;token=05744d26-c2de-4343-91a8-e91a7cbf4482" alt=""><figcaption></figcaption></figure>

***

## FAQ's

<details>

<summary>Can I use multiple APIs in one chatbot flow?</summary>

Yes, you can configure multiple APIs and call them at different stages in your flow.

</details>

<details>

<summary>What if my API requires authentication headers?</summary>

You can add authorization tokens or keys in the \*\*Headers section\*\* of your API setup.

</details>

<details>

<summary>Can I pass user inputs dynamically to the API?</summary>

Yes, by mapping \*\*custom attributes\*\* to API parameters, headers, or body fields.

</details>

<details>

<summary>What happens if the API fails?</summary>

BotPenguin automatically follows your \*\*fallback path\*\* (error or unknown error configuration).

</details>

<details>

<summary>Where can I debug API failures?</summary>

Check the \*\*API Logs\*\* section in the Developer tab to see request and response details.

</details>

***

If everything is correct and you are still unable to move forward, write to us at **<support@botpenguin.com>**. We will respond back within 48 business hours.
