Webapp 2 Salesforce iCare Integration (CPC)

Introduction

The integration between Webapp and Salesforce iCare aims to provide Webapp users with information about campaign products (CPCs) visible to a given Customer Service Representative (CSR) and ensure that unavailable CPCs in Salesforce are not used.

Goals

Constraints

Enterprise Constraints

Business Constraints

Technology Constraints

Integration Flow: OAuth 2.0 Web Server Flow

  1. A WEBAPP user clicks the “REFRESH CPCs” button.
  2. The connected app sends an authorization code request to the Salesforce authorization endpoint.
  3. Users are redirected to the Salesforce login page. Upon successful login, users approve the app’s access to order status data.
  4. Salesforce sends a callback to the WEBAPP with an authorization code after approval.
  5. The WEBAPP passes this code to the Salesforce token endpoint to request an access token.
  6. Salesforce validates the code and sends back an access token with permissions (scopes).
  7. The WEBAPP app requests CPC data from Salesforce using the access token.
  8. Salesforce validates the token and scopes.
  9. The WEBAPP app accesses the protected data, retrieving CPCs.

Webservice Exposing CPC to Webapp

Technology

Method

Details

Example Response

{
  "EMAIL": "bartosz.borowiec-ext@solvay.com",
  "IS_SUCCESS": true,
  "ERROR_MESSAGE": "",
  "CPCS": [
    {
      "CAMPAIGN_NAME": "CP1",
      "WEBAPP_CPC_ID": "12423",
      "CPC_NAME": "123443243",
      "CPC_PRODUCT_CODE": "",
      "CPC_SOLDTO_CODE": "",
      "CREATED_DATE": ""
    },
    {
      "CAMPAIGN_NAME": "CP2",
      "WEBAPP_CPC_ID": "12425",
      "CPC_NAME": "123443243",
      "CPC_PRODUCT_CODE": "",
      "CPC_SOLDTO_CODE": "",
      "CREATED_DATE": ""
    }
  ]
}

Field Mapping

SF FieldJSON Field
User.EmailEMAIL
List of Pricing_Campaign_CPC__c wrappersCPCS
Pricing_Campaign_CPC__r.CreatedDateCREATED_DATE
Pricing_Campaign_CPC__r.Pricing_Campaing__r. NameCAMPAIGN_NAME
Pricing_Campaign_CPC__r. NameCPC_NAME
Pricing_Campaign_CPC__r. Product_code__cCPC_PRODUCT_CODE
Pricing_Campaign_CPC__r. Sold_To_Code__cCPC_SOLDTO_CODE
Indicates if the action was a success or notIS_SUCCESS
Error messageERROR_MESSAGE
Pricing_Camnaing_CPC__r.PP_WebappCPCID__cWEBAPP_CPC_ID

CPC Filtering

Only CPCs from campaigns that are active (Campaign End Date > Today) are sent to Webapp.

Access Determination to Interface

  1. The business provides a user list. These users will receive the PP_WebappIntegration permission set, enabling access to the PP_WebappCPCS class.
  2. The Webapp interface access to PP_WebappCPCS will be added to the profiles:

New Field: Pricing_Campaing_CPC__r.PP_WebappID__c