Add External API in Sprinklr

Updated 

Sprinklr offers a streamlined way to import, configure, and create API extensions using the UI. This significantly reduces the turnaround time for configuring third-party APIs on Sprinklr’s platform.

Once configured, you can call third-party (external) APIs during workflow execution across various capabilities such as Bots, Guided Workflows, Agent Consoles, Care Consoles, Automation, and more. This new feature enhances automation and eliminates manual processes, boosting productivity.

Note: Configuration is required. Please contact the Managed Services team for further assistance.

Prerequisites

You need to add an External Authentication Credential in Sprinklr. For more information, refer to Add an External Authentication Credential in Sprinklr .

Note:

  • For static APIs, external authentication credentials are not required.

  • You can register an External API in Sprinklr only if you are a Global Admin or Global User.

  • If you are an administrator and wish to grant users permission to add an external API, create a role with the following permissions and assign it to the correct user or user group.

Steps to Register an External API

  1. Click the New Tab Space Add New Tab Icon icon . 

  2. Under the Platform Module, click All Settings within Listen.

  3. In the Platform Settings window, click Manage Customer in the left pane and select External API from the list of options in the right pane. You can also search for it using the search bar.

  4. In the External API window, click Add External API in the top right corner.

  5. In the External API window, fill in the following details:

    • External Service Name: Enter the name of the external service.

    • Description (optional): Provide a description for the external service.

    • Authentication Credential: Enter the required authentication credential.

    • OpenAPI Specification: Enter the service schema in JSON format.

In the 18.2 release, we introduced a tool to convert Postman response collections to OpenAPI specs for testing APIs on the platform. Follow these steps:

1.At the bottom of the configuration page, click Convert Postman Collection to OpenAPI spec.

2.Enter either the Postman collection URL or the Postman collection JSON script.

3.Insert the JSON and click Convert.

4.The Postman response will be successfully converted to OpenAPI spec with a confirmation message.

5.Click Validate in the bottom right corner of the External API window.

6.After validating the OpenAPI, you can view and verify the endpoint details fetched by the API.

6. Click Validate in the bottom right corner of the External API window.

Note: You can now define field type for the request parameters present in the external API. Supported field types include String, Integer, Number, Boolean, Object, and Form.

7. (Optional) Check the Request via Proxy box if you wish to expose the APIs via proxies. Ensure that the Sprinklr Static IP Addresses for Receiving API Calls are whitelisted. You can also add Proxy Host and Proxy Port fields when you check the Request via Proxy checkbox.

8. Click Save in the bottom right corner to register the external API.

Manage an External API

  1. Click the New Tab Space Add New Tab Icon icon.

  2. Under the Platform Module, click All Settings within Listen.

  3. In the Platform Settings window, click Manage Workspace and select External API from the options. You can also search for it in the search bar above.

  4. In the External API window, click the Options icon baseline_more_vert_black_18dp.png and alongside to External Service Name and select either Edit or Delete as needed.

  5. You can edit and Update the URL and Authentication credential from the UI.

Automated Groovy Generator for REST API

In 19.8 release, we have introduced an Automated Groovy Generator that streamlines the process of configuring REST-based external APIs by automatically generating the necessary Groovy script for request adapters.

How it Works?

When configuring a REST API, you can use the Generate Adapter button. Upon clicking this button, the system will automatically generate the Groovy script tailored to your specific API configuration. This script will then be directly pasted into the request adapter text box, eliminating the need for manual coding.

Groovy generator.

This feature enhances the overall user experience by making REST API configuration more efficient and less prone to manual errors.