Best Practice Guide for Adding External APIs in Sprinklr

Updated 

To Get the OpenAPI Specification

Tip

You are required to convert a Postman collection to OpenAPI (JSON format).

This section describes how to convert a Postman collection to the OpenAPI 3.0.0 standard that can then be utilized for the configuration of a Sprinklr External API.

STEP 1: To Export the Postman Collection

Tip

Make sure all endpoints of your Postman collection are working properly, then export it.

  1. Select the more actions icon More actions icon next to the Collection, then select Export.

  2. Select the format you'd like your collection to export as. For more information about Postman's collection formats, see Travelogue of Postman Collection Format v2.

  3. Select Export to download your newly generated JSON file.

Step 2: Convert from Postman to OpenAPI

You can use the inbuilt service in sprinklr to convert postman collection to openAPI tool which is available in All settings-> Manager customer -> External API

2. You can also use Swagger Editor for validating your Open API Spec

Step 3: To Add the "operationId"

For each endpoint in the JSON, define an operationId within the endpoint configuration. Please note if you re-add or re-configure the same API within Sprinklr, modfiy the operation ID every time to enaure that the previous configuration changes gets overrriden.

Step 4: To Replace Variables (if needed)

Please make sure that your variables are defined. For example, replace {{url_endpoint}} with your actual endpoint.

To use the OpenAPI Specification in Sprinklr API Extension

To Create the External API

You are required to paste the OpenAPI specification in the External API certification configuration.

To Configure Endpoints

For each endpoint, set the Headers, Path Parameters and Request Body.

To Set Adapters (If needed)

Map<String, String> filter = MAP_UTILS.newMap();

filter.put("customerId", REQUEST.get("filter.customerId"));

REQUEST.remove("filter.customerId");

filter.put("tel", REQUEST.get("filter.tel"));

REQUEST.remove("filter.tel");

filter.put("firstname", REQUEST.get("filter.firstname"));

REQUEST.remove("filter.firstname");

filter.put("lastname", REQUEST.get("filter.lastname"));

REQUEST.remove("filter.lastname");

REQUEST.put("filter", filter);

return REQUEST;

Use the Extension anywhere (for example in a Guided Workflow)

For more information, about how to Guided Workflows in Sprinklr, see ‎Guided Workflows | Sprinklr Help Center

To Add an API Service Task

To Set the Input Values

To Set the Output Values

To Use the Output values in the Guided Workflow

To Access and View the Display the Guided Workflow in the Care Console

At the moment, this step requires help from the Product team and/or the Demo Engineering team to:

  • Create the custom view of the Care Console (can be done by the demo engineering team at the moment)

  • Associate the view to the user (requires the Product team to associate the view from the backend)