Kony Fabric console User Guide: Integration > Configure the Integration Service > Salesforce Adapter

Salesforce Adapter

Configure Salesforce Endpoint Adapter

To configure Salesforce service in the Integration Service Definition tab, follow these steps:

  1. In the Name field, provide a unique name for your service.
  2. From the Service Type list, select Salesforce.
  3. Provide the following details to create the Salesforce service:
  4. Field Description
    Authentication
    • Use Existing Identity Provider - to select an identity provider. This drop-down lists all identity providers only if you have already created identity providers for SAP in the Identity page. Fill in the details for the following fields:
      1. From the Select Identity Provider list, select your Salesforce identity.

        The details for the selected identity are displayed in the Endpoint URL text box. You cannot modify these details.

      2. Under the User ID and Password, provide valid log-in credentials that you created while registering with Salesforce services.
    • Specify Login Endpoint- to configure a new endpoint. Fill in the details for the following fields:
      1. In the Endpoint URL, enter the URL - for example, https://login.salesforce.com/services/oauth2/token.

      2. In the Client ID text box, enter a valid client id.

      3. In the Client Secret text box, enter a valid client secret.

      4. In the User ID text box, enter a valid user ID.

      5. In the Password text box, enter a valid password.

  5. Note: All the fields in the Advanced section are optional.

  6. In the Description field, provide a suitable description for the service.

  7. To enable the proxy, select the Use proxy from settings check box. By default, the check box is cleared. The Use proxy from settings check box dims when no proxy is configured under the Settings > Proxy.

  8. Click Save to save your service definition.

Create Operations for Salesforce

The Operations List tab appears only after the service definition is saved.

Note: Click Operations List tab > Configure Operation. The Configured Operations list appears.

To create an operation, follow these steps:

  1. Click SAVE & ADD OPERATION in your service definition page to save your service definition and display the NewOperation tab for adding operations.
                        OR
    Click Add Operation to add a new operation or from the tree in the left pane, click Add > Add New Operation.

  2. Select an object from the Object list that is auto-populated with all the existing Salesforce objects.

    Note: If you provide incorrect Salesforce endpoint details, the Object list will contain only _Login object.

  3. Based on the object added in the previous step, the Operation Name is listed with operations. Select the check boxes for required operations.
  4. Based on the object selected, a list of operations is displayed in the dropdown. Select the required operations and click Add Operation.
  5. The selected operations are added to the Operations List section and the new Salesforce service is added to the Integration page.
  6. To edit an operation, either click on the required operation name or click Edit from the Settings in the Operations List screen. The operation details page is displayed.
  7. To configure an operation, provide the following details:

    Field Description
    Name Enter a unique name for your operation.
    Operation Security Level

    It specifies how a client must authenticate to invoke this operation.

    Operation Path

    Modify the path if required.

    Note: If you provide incorrect Salesforce endpoint details, the Object list will contain only _Login object.

  8. Note: All options in the Advanced section are optional.

Configure Request Operation for Salesforce

Integration services accept only form-url-encoded inputs for all the input parameters provided in the service input parameters (request input).

You can perform the following actions in Request Input tab:

  1. Click Add Parameter to add an entry (if the entries for input and the output tabs does not exist).
  2. To make duplicate entries, select the check box for the entry, click Copy and Paste.
  3. To delete an entry, select the check box for an entry and click Delete .
  4. To configure the Request Input tab, provide the following details:
  5. Field Description
    Name It Contains a Unique Identifier. Change the name if required.
    Test Value Enter a value. A test value is used for testing the service.
    Default Value Enter the value, if required. The default value will be used if the test value is empty.
    Scope

    Select Request or Session. It is set to Request by default.

    • Request indicates that the value must be retrieved from the HTTP request received from the mobile device.
    • Session indicates that the value must be retrieved from the HTTP session stored on Kony Fabric.
    Datatype
    Encode

    Select the check box to enable encoding of an input parameter. For example, the name New York Times would be encoded as New%20York%20Times when the encoding is set to True. The encoding must also adhere to the HTML URL encoding standards.

  6. To validate the operation details, click Save and Test. For more details, refer to Test a Service Operation.

Configure Response Operation for Salesforce

  1. Click the Output tab, and enter the values for required fields such as ID, scope, data type, collection ID, record ID, format and format value.

    Note: If you define parameters inside a record as the session, the session scope will not get reflected for the parameters.

  1. To validate the operation details, click Save and Test. For more details, refer to Test a Service Operation.

  2. Click Save Operation to save the operation. The system displays the Operation section for your service.
  3. Click Done to navigate to the Integration page.

    Note: To use an existing integration service, refer to How to Use an Existing Integration Service.

    Note: You can view the service in the Data Panel feature of Kony Visualizer. By using the Data Panel, you can link back-end data services to your application UI elements seamlessly with low-code to no code. For more information on Data Panel, click here.

How to Use Log-in Endpoint with Different Credentials for Design Time and Runtime

If the service is using a log-in endpoint, ensure that you specify the same set of credentials (Client ID, Client Secret, User ID, Password) for design time and run-time.

If the log-in endpoint credentials are different for design time and run-time, the system throws an error while accessing a service from an app.

Error 401: Request Unsuccessful Server responded with 401.

If you want to the use log-in endpoint with different credentials for design time and run-time, then parametrize instance URL in the operation path, and send that URL from an app.

For example:

To parametrize an instance URL, follow these steps:

  1. In the login operation, click Output tab, and make the following changes:

    IDPathScope
    Authorization concat(//OAuth/token_type," ",//OAuth/access_tokensession
    instanceURL //OAuth/instance_url session
  2. Click Test to view the results.
  3. Click Save Operation to save the changes.
  4. In the getContact operation, make the following changes:
    1. In the Operation Path text box, change the URL, for example, from  https://ap1.salesforce.com/  to    $<instanceURL>/.

    2. In the Input tab, configure the following fields as shown:
      IDPathScopeEncode
      queryString Select ID from contactsession  
      instanceURL //OAuth/instance_url session No
  5. Click Test to fetch the contacts from Salesforce.
  6. Click Save Operation.

 

Copyright © 2020 Kony, Inc. All rights reserved.