Integrate Pega with an external REST API

Hi everyone,

How do you integrate Pega with an external REST API to retrieve customer information. How do you approach this?

Regards,

YerniKumar

@YERNIKUMARD

Steps to Integrate Pega with an External REST API

  1. Understand the API Requirements:

    • Obtain the API endpoint URL.
    • Understand the request/response format (e.g., JSON or XML).
    • Identify the necessary authentication method (e.g., Basic Auth, OAuth, API keys).
    • Review the API documentation for required parameters and headers.
  2. Create a Connector:

    • Use Pega’s Connect-REST rule to create a connector to the external REST API.
  3. Configure Authentication:

    • Set up the necessary authentication profile in Pega.
  4. Create Data Page:

    • Use a data page to load the data retrieved from the REST API.
  5. Map Data:

    • Map the request and response data to and from Pega properties.
  6. Test the Integration:

    • Test the connector and data page to ensure the integration works as expected.

Detailed Steps

  1. Understand the API Requirements:

    • Obtain the API endpoint, request method (GET, POST, etc.), headers, parameters, and authentication details from the API documentation.
  2. Create a Connector:

    • Go to Records > Integration-Connectors > Connect-REST.
    • Click Create to create a new Connect-REST rule.
    • Fill in the details:
      • Endpoint URL: The URL of the REST API.
      • Resource Path: The specific resource path, if needed.
      • HTTP Method: The method used (e.g., GET, POST).
  3. Configure Authentication:

    • Go to Records > Security > Authentication Profile.
    • Click Create to create a new authentication profile.
    • Configure the authentication type (Basic, OAuth, etc.) and credentials.
  4. Create Data Page:

    • Go to Records > Data Model > Data Page.

    • Click Create to create a new data page.

    • Configure the data page:

      • Mode: Choose “Read-Only”.
      • Object Type: The type of data the page will hold (e.g., Customer).
      • Scope: Choose the appropriate scope (Thread, Requestor, Node).
    • In the Data Sources section, choose Connector and select the Connect-REST rule you created.

  5. Map Data:

    • In the Connect-REST rule, go to the Request and Response tabs.
    • Map the Pega properties to the API request parameters and response fields.
  6. Test the Integration:

    • Test the Connect-REST rule by running it directly and checking the response.
    • Test the data page to ensure it loads data correctly.

Hi @Satyasaicharana,

  1. Create a Data Page: Define a data page that will be used to store the customer information retrieved from the external API.
    • Navigate to Records > Data Model > Data Page and create a new data page.
  2. Configure Data Source: Set the data source to “Connect REST” in the data page.
  3. Create a REST Connector:
    • Navigate to Integration > Connectors > Create REST Connector.
    • Provide the necessary details like endpoint URL, HTTP method, and request/response parameters.
  4. Map Request and Response: Configure request and response data transforms to map the Pega data model to the external API’s data model.
  5. Use the Data Page: In the case type or flow, reference the data page to fetch and display customer information.
    • For example, in a UI section, you can reference the data page property to display the customer details.

Regards,

Prasad

Hi @YERNIKUMARD

Please find the following attachment.

ConnectRESTAPI.docx (138 KB)

@YERNIKUMARD

Please follow this link to create the REST connector through the Integration Wizard.

Pegasystems Documentation?