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
- Securely provide CPC visibility information to Webapp users.
- Prevent the use of non-available CPCs in Salesforce.
Constraints
Enterprise Constraints
- The solution must be secure, ensuring only authorized personnel can view their CPCs.
Business Constraints
- Define a list of users or an algorithm for accessing the Webapp interface.
Technology Constraints
- API call limits in Salesforce must be considered, implementing a caching mechanism within Webapp.
Integration Flow: OAuth 2.0 Web Server Flow
- A WEBAPP user clicks the “REFRESH CPCs” button.
- The connected app sends an authorization code request to the Salesforce authorization endpoint.
- Users are redirected to the Salesforce login page. Upon successful login, users approve the app’s access to order status data.
- Salesforce sends a callback to the WEBAPP with an authorization code after approval.
- The WEBAPP passes this code to the Salesforce token endpoint to request an access token.
- Salesforce validates the code and sends back an access token with permissions (scopes).
- The WEBAPP app requests CPC data from Salesforce using the access token.
- Salesforce validates the token and scopes.
- The WEBAPP app accesses the protected data, retrieving CPCs.
Webservice Exposing CPC to Webapp
Technology
Method
Details
- Class Name: PP_WebappCPCS
- URL: Webapp_CPCS
- Call Parameters: None (response based solely on user context)
- Connected App Name (Label & API): WebappCPCS
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 Field | JSON Field |
|---|
| User.Email | EMAIL |
| List of Pricing_Campaign_CPC__c wrappers | CPCS |
| Pricing_Campaign_CPC__r.CreatedDate | CREATED_DATE |
| Pricing_Campaign_CPC__r.Pricing_Campaing__r. Name | CAMPAIGN_NAME |
| Pricing_Campaign_CPC__r. Name | CPC_NAME |
| Pricing_Campaign_CPC__r. Product_code__c | CPC_PRODUCT_CODE |
| Pricing_Campaign_CPC__r. Sold_To_Code__c | CPC_SOLDTO_CODE |
| Indicates if the action was a success or not | IS_SUCCESS |
| Error message | ERROR_MESSAGE |
| Pricing_Camnaing_CPC__r.PP_WebappCPCID__c | WEBAPP_CPC_ID |
CPC Filtering
Only CPCs from campaigns that are active (Campaign End Date > Today) are sent to Webapp.
Access Determination to Interface
- The business provides a user list. These users will receive the PP_WebappIntegration permission set, enabling access to the PP_WebappCPCS class.
- The Webapp interface access to PP_WebappCPCS will be added to the profiles:
- System Administrator
- System Admin (Lite)
- Sales User Lightning (No delete)
- Management User Lightning (No delete)
- GBU Data Steward
- CSR User Lightning
- ADL User Lightning
- Agent User Lightning
- B2BMA Integration User
- and more...
New Field: Pricing_Campaing_CPC__r.PP_WebappID__c
- Type: TEXT
- Max Length: 255
- Is Unique: No
- Is External Id: No
- Accessible To: Admin, System Admin (Lite) profile, Pricing Campaign Access - permission set.