Teaching how to integrate Salesforce with ICS

This section shows you how to use the Salesforce ICS Connector that comes out of the box.

Configure your Salesforce Connector in ICS

First of all, in order to create a Salesforce Connector for this we need the Salesforce Enterprise WSDL. This will require you to create an Application within your LinkedIn account and use the “Application ID” and “Application Secret”. Follow the next steps to do this:

Perform the following steps to generate the WSDL file:

  • Save the WSDL into your integration folder

  • Remove the first line and comment in the WSDL, so that it starts at the <definitions element. It should start like this:

If necessary, you can find more information at http://www.salesforce.com/us/developer/docs/api/index.htm

Create a Campaign in Salesforce

In the coming sections, we are going to use the OOTB Salesforce adapter in ICS to connect to Salesforce. For this, we are going to create a new Campaign in Salesforce and then we are going to use its ID to update it.

  • Login to salesforce
  • Go to Campaigns

  • Create a New one and enter as many details as you want and click on Save.

  • When you have your Campaign open, notice the browser’s URL – It will look something like this:

https://ap1.salesforce.com/70190000000Xf4w

The last bit after the slash is the campaign ID. Record that value, you will need it for the next section

Create a Salesforce Connection in ICS:

In this section we are going to create a Salesforce Connection that will simplify the integration

  • Open ICS and go to Connections
  • Click on Create New Connection
  • Select Salesforce adapter

  • Enter a sensible name and Description.
  • Set the Connection Role to Invoke. Then click on Create

  • Enter a Connection Administration Email if you want
  • Click on “Configure Connectivity

  • Tick on “Upload File” option and upload your Salesforce Enterprise WSDL that you retrieved previously from Salesforce. When done, click on OK.

  • Then click on “Configure Security

  • Enter your Salesforce user and “the concatenation of your password and the security token”

For example:  If your password is mypassword, and your security token is XXXXXXXXXX, then you must enter mypasswordXXXXXXXXXX

Note: If you don’t have your Security Token or you have forgotten what it was, an easy way to reset it is by logging into Salesforce and at the top navigation bar go to your name > Setup > Personal Setup > My Personal Information > Reset My Security Token.

  • Then click OK.
  • Click on Save, Test and Save to complete the connection.

Create a REST connection in ICS

In this section we are going to create a very simple REST connector that will allow us to integrate into Salesforce via the Salesforce connector that we just created earlier.

Note: This is a generic REST connector. If you have already completed the other blogs around how to build an Integration to either Facebook, LinkedIn, Google Calendar, etc. Then potentially you can simply reuse that REST connector. If not, feel free to create one and enter a different name.

  • Log into ICS and go to Connections.
  • Click on “Create New Connection” – This time select REST adapter.

  • Enter a name for your REST adapter. In my case, I’m calling it “s2v-iia-rest-msg-connector”
  • In this case, I just want it to trigger my post, so I select just Trigger.
  • Enter a description if you want. Then click on Create

  • Enter an email if you want.
  • We are not setting any security for now.
  • Click Save and then Test. Ensure you get a green 100% status. Click save again and “Exit Connection

  • Congratulations, you have created two connectors! One Salesforce connector and one REST connector. In the next section we are going to build an integration between them.

Update you Campaign details in Salesforce using a REST API using ICS

In this section we are going to create a very simple integration to update Salesforce Campaigns. We will expose this as a REST API using both connectors that we built previously, the Salesforce and REST connectors respectively.

  • Log into ICS if not already there
  • Go to Integrations.
  • Click on “Create New Integration”

  • For now, let’s just create a simple mapping. Select “Basic Map Data

  • Enter a name for your Integration. In my case, I call it “s2v-iia-rest2sf-integration
  • Enter a description if you want and then click “Create

  • You will get a clean integration.

  • On the right, find the REST connector that you built earlier. If you have many, you can enter part of the name at the top and the list will be filtered.

  • Once you have your REST adapter on the list of connections, drag and drop it to the “Drag and Drop a Trigger” section
  • It will open the REST connector configuration wizard.

  • Enter the following information:
    • What do you want to call your endpoint: SalesforceAPI
    • What does this endpoint do? This endpoint will receive a message and send it to Salesforce adapter, so that it updates the specified Campaign.
    • What is the endpoint’s relative resource URI? /salesforce/campaign
    • What action does the endpoint perform? POST
    • Configure a request payload for this endpoint: Ticked
    • Configure CORS (Cross Origin Resource Sharing): Ticked

  • Click Next.
  • Select the Request Payload Type: JSON

  • Click on the <> link and enter a JSON format as you wish to send your POST body payload. Something like:

    {“campaign”:”ID”, “description”:”desc”}

  • Then, click OK.
  • Leave the Media Type to JSON, and click Next.

  • CORS Configuration – Allowed Origins: *

  • Click Next. For the summary, review all and click Done.

  • That’s it, we have configured a REST Trigger, as part of this integration.
  • Now, search for your Salesforce connection and drag and drop it into the “Drag and Drop an Invoke” droppable area.
  • It will show you the Salesforce connection wizard. Enter a name and description.

  • Click Next. Select Update as the CRUD operation and search for the Campaign Business Object and move it to the right panel.

  • Click Next. Leave the Headers by default and click Next.
  • Review the Summary and click “Done“.

  • The integration should look like this:

  • Click on the Map in the middle and then click +

  • Salesforce Enterprise WSDL can be pretty daunting. For example simply for Campaigns, it has over 185,445 sub-elements. This is the type of complexity that ICS is helping us deal with. If you see a Warning saying that the target update schema has a large number of elements… just say OK, in this case we are going to update only the “Description” – If we had to update an element that is not shown, we would have to use other approaches, such as SOQL.

  • In the mapper drag the campaign and description messages under “request-wrapper” into the target id and description respectively.

Notice that the structure within “request-wrapper” is the one that you defined when creating freely the JSON payload that you are expecting as input. Pretty cool huh?

  • Click Save.

  • Exit the mapper. The integration should look like this:

  • Click on “Tracking”

  • Drag and drop the campaign (id) element under “request-wrapper” into the Tracking Field

  • Save your integration.

Notice that it shows a warning because we don’t have any response and fault. In a real scenario we would configure those, but we didn’t select it in this example for simplicity purposes.

  • Exit the Integration. Notice that your integration is still to be “Activated”

  • Click on the green “Activate” label on your adapter.
  • Select to Enable tracing and click Yes.

  • Congratulations! Your integration is complete.
  • Click the “information” icon for your integration and copy the Endpoint URL

Since I am using a test environment, the Endpoint is not connected to the Public Cloud, if you click on it will open up a broken link. If you are using your own ICS account, you will not experience this situation. However, let me tell you how I fixed mine… I just removed the “ics/faces/null/” bit from the URI.

I will end up to something like this:

https://[server_location]/integration/flowapi/rest/S2V_IIA_REST2SF_INTEGRAT/v01/metadata?_afrRedirect=2433011409142

  • Try it in a browser and make sure you get the expected metadata:

Notice that it will show you the Metadata descriptor of your REST API endpoint, for example, the Accepted Media Type, A JSON request sample, Allowed methods, CORS configuration, etc.

  • Use POSTMAN, SOAPUI or any other REST Test client to send a REST POST command. In this case I am using SOAPUI.

  • In order to get the Endpoint URL, copy the link below and remove the last bit from “metadata”. Then just copy the API that you designed, you can copy it from the metadata page. In this case: “‘/salesforce/campaign”

 

The REST API will be something like this:

https://%5Bserver_endpoint%5D/integration/flowapi/rest/S2V_IIA_REST2SF_INTEGRAT/v01/salesforce/campaign/salesforce/campaign

The last bit in red represents the actual URI of your API created in ICS.

  • Make sure to change the method to POST and in the body enter the POST body payload in the structure that you created as part of the ICS integration. You can also copy the entered JSON sample from the metadata page:

  • In my case I entered this:

{“campaign”:”70190000000Xf4w“,”description”:”Welcome to the Speed 2 Value – Integration in Action Wroskhop“}

Note: You can get the campaign ID by going into “Campaigns” in your Salesforce dashboard and click on the Campaign that you wish to update. Then that part after “…salesforce.com/” in the browser’s URL is the Campaign’s ID.

  • Leave the Media Type as application/json

  • Click the green icon to send the request. You will receive a 202 Accepted response – See that as Raw

  • Finally, go back to your Salesforce dashboard and make sure the selected Campaign’s description was updated accordingly:

  • Congratulations! You just integrated to Salesforce via Oracle Integration Cloud Service.

Author: Carlos Rodriguez Iturria

I am extremely passionate about people, technology and the most effective ways to connect the two by sharing my knowledge and experience. Working collaboratively with customers and partners inspires and excites me, especially when the outcome is noticeable valuable to a business and results in true innovation. I enjoy learning and teaching, as I recognise that this is a critical aspect of remaining at the forefront of technology in the modern era. Over the past 10+ years, I have developed and defined solutions that are reliable, secure and scalable, working closely with a diverse range of stakeholders. I enjoy leading engagements and am very active in the technical communities – both internal and external. I have stood out as a noticeable mentor running technology events across major cities in Australia and New Zealand, including various technology areas such as, Enterprise Integrations, API Management, Cloud Integration, IaaS and PaaS adoption, DevOps, Continuous Integration, Continuous Automation among others. In recent years, I have shaped my role and directed my capabilities towards educating and architecting benefits for customers using Oracle and AWS Cloud technologies. I get especially excited when I am able to position both as a way to exceed my customers’ expectations. I hold a bachelor degree in Computer Science and certifications in Oracle and AWS Solutions Architecture.

9 thoughts on “Teaching how to integrate Salesforce with ICS”

  1. Excellent blog.Could you please help to how to create cases/update in sales using Oracle ICS. I am doing integration from Zendesk to SalesForce. If external I’d of Zendesk is present in Salesforce I need to update case or else I need to create case.

    Liked by 1 person

  2. Could you please help to how to create cases/update in sales using Oracle ICS. I am doing integration from Zendesk to SalesForce. If external I’d of Zendesk is present in Salesforce I need to update case or else I need to create case.

    Liked by 1 person

    1. Hi Shivanand, “Case” are one of the standard Business Objects supported by the Oracle ICS Salesforce connector… When you drop the Salesforce connector to the right of an integration pane, you can select CRUD (create or update) and then select “Case” from the list of Business Objects. As for connecting to Zendesk, I am not familiar, does it support REST APIs? If you need more information, in order to reduce my response time, please contact me directly my message at https://www.linkedin.com/in/citurria/

      Like

  3. Hi I have sync. Accent information from Salesforce to engagement cloud, but response is failing with below mesh.

    Client received SOAP Fault from server : Unable to find a deserializer for the type common.api.soap.wsdl.QueryResult Error Id: 1285309289-28170 (-1896990142)Cause : Problem could be in the request mapping. Solution : All mapped elements should belong to the parent object.

    Like

Leave a comment