Article Ingestion through External API

Updated 

This guide describes how to configure an External API–based Import Data Connector to ingest Knowledge Base articles into Sprinklr.

The solution uses a modular, event‑driven design that includes:

  • A Custom Entity to store Knowledge Base article identifiers and metadata

  • An External API Connector to ingest data from the customer’s system

  • Custom Entity Triggers to initiate downstream processing

  • A Groovy script to create or update Knowledge Base articles in Sprinklr

This approach enables scalable ingestion while keeping data retrieval, processing, and article creation logically separated.

Workflow Overview

The ingestion workflow follows these steps:

  1. The External API Connector calls the customer’s API.

  2. The API returns Knowledge Base article IDs and related metadata.

  3. The connector stores the data in a Custom Entity.

  4. A Custom Entity Trigger fires when a new record is created.

  5. The trigger invokes a Groovy script.

  6. The Groovy script:

    • Calls an External API to fetch complete Knowledge Base article details.

    • Creates or updates the Knowledge Base article in Sprinklr.

This architecture separates data ingestion, processing logic, and Knowledge Base creation, making the integration easier to maintain, extend, and scale.

Prerequisites

Before you begin, ensure the following components are configured.

Step 1: Create a Custom Entity

Create a Custom Entity in Entity Studio to store Knowledge Base article identifiers and related fields.

What to Configure

  • Define fields for:

    • Knowledge Base article ID (required)

    • Any metadata required to fetch or identify the article

  • Ensure field data types match the API response.

Note: Misaligned data types can cause ingestion or trigger failures.

Purpose

  • Acts as the intermediate data store

  • Triggers downstream Knowledge Base creation logic

  • Decouples ingestion from Knowledge Base article creation

For detailed steps, see Create a Custom Entity.

Step 2: Create Custom Entity Triggers

In Entity Studio, configure a Custom Entity Trigger.

Trigger Configuration

  • Trigger event: On entity creation

  • Action: Invoke a Groovy script

Purpose

  • Automatically process each ingested Knowledge Base record

  • Initiate Knowledge Base article creation or update logic

For more information, see Configuring Triggers.

Implement the Groovy Script

The Groovy script performs the core processing logic.

Script Responsibilities

  • Read the Knowledge Base article ID from the Custom Entity record.

  • Call an External API to fetch full Knowledge Base article details.

  • Create or update the Knowledge Base article in Sprinklr.

Use the following utility function to invoke an External API:

Map<String, Object> HTTP_UTILS.invokeEndpoint(

String endpointId,

String credentialsId,

Map<String, String> headers,

Map<String, Object> params,

Object payload

)

Step 3: Create an External API

Create an External API in the Extensions Library. This API will be invoked by the Import Data Connector.

Responsibilities

  • Store endpoint URL and authentication details

  • Define request headers and parameters

  • Fetch Knowledge Base article IDs and metadata from the customer’s system

For details, see Extensions Library.

Configure the Response Adapter

Configure a Response Adapter in the External API to make the response consumable by the Data Connector.

Responsibilities of the Response Adapter

  • Extract Knowledge Base article records from the API response

  • Normalize the response into a standard structure

  • Support pagination for large datasets

This ensures all Knowledge Base identifiers are ingested reliably.

Configure Knowledge Base Article Ingestion

Follow these steps to configure Import Data Connector for an External API data connector.

Step 1: Navigate to Data Connector

  1. Open the Sprinklr Launchpad.

  2. Navigate to Data Connector.

Step 2: Select the Target Entity

On the Entity Selection screen:

  1. Select the Custom Entity that you configured for Knowledge Base article.

  2. Select Next.


Step 3: Select Integration Type

On the Entity‑Specific Settings screen:

  1. Select the integration type you want to create.

  2. For details on supported integration types, see Supported Entity Types.

  3. Select Next.

Step 4: Configure Source Selection

On the Source Selection screen, configure the following fields:

  • Entity Source: Select External API.

  • Connector Name: Enter a meaningful name for the connector.

  • Description: Provide a brief description of the data pipeline.

Select Next.


Step 5: Configure Source‑Specific Settings

On the Source‑Specific Settings screen, configure the following:

  • Endpoint ID: Select the External API endpoint to fetch data from.

  • Pagination Type: Select between Cursor‑based or Offest-based depending on your use case.

  • Cursor‑based Logic: Uses a reference from the last item to get the next set.

  • Offest-based: Uses item count to jump to the next set of results.

These settings determine how data is fetched and iterated during execution.

Once the endpoint is successfully validated, the system automatically opens the Mapping Configuration screen.


Step 6: Configure Data Mapping

On the Mapping Configuration screen:

  1. Map External API fields to the corresponding Custom Entity attributes.

  2. Ensure data types align correctly to prevent ingestion errors.

For detailed guidance, see Mapping Configuration Screen.

Select Next to continue.


Step 7: Configure Additional Settings

On the Additional Settings screen, configure the following:

  • Share Settings: Define access and visibility for the connector.

  • Schedule Settings: Define when and how often the connector runs. Configure the following fields in Schedule Settings section:

Execution Flow

Once configured:

  • The Import Data Connector fetches Knowledge Base article IDs from the customer’s API.

  • Records are stored in the Custom Entity.

  • Entity Triggers fire on record creation.

  • The Groovy script fetches full Knowledge Base content.

  • Knowledge Base articles are created or updated in Sprinklr.