App Connect

 View Only
Expand all | Collapse all

Using the Salesforce Request node

  • 1.  Using the Salesforce Request node

    Posted Fri January 20, 2023 07:39 AM
    Hi

    I am trying to set up a flow that reads data from Salesforce using the Salesforce Request Node. I have watched the Youtube clips and gone through the tutorial sample, but there's no clarity on exactly how you do the following:

    1) Register a Connected App
    2) Get the client ID
    3) Get the client secret

    Can anyone assist?

    Thanks

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------


  • 2.  RE: Using the Salesforce Request node

    Posted Mon January 23, 2023 04:02 AM

    Hi Peter,

    Are you using App Connect Enterprise 12? If so, you might find some of this info helpful: https://www.ibm.com/docs/en/app-connect/12.0?topic=discovery-configuring-secure-connection-salesforcecom-no

    There's also detailed info here if you are using IBM App Connect on IBM Cloud or App Connect in containers. (You can expand the "authorization method" twisties to view the instructions, which include details for creating a connected app and generating the Client ID and Client secret values.)

    • https://www.ibm.com/docs/en/app-connect/cloud?topic=salesforce-connecting-from-app-connect-cloud
    • https://www.ibm.com/docs/en/app-connect/containers_cd?topic=salesforce-connecting-from-containerized-environment-local-connector


    Hope this helps,

    Fiona

    ------------------------------
    fionadav EC2B
    IBM
    London
    ------------------------------



  • 3.  RE: Using the Salesforce Request node

    Posted Mon January 23, 2023 06:32 AM
    Hi Peter,

    Hopefully the following topics in the ACE V12 documentation will be helpful:

    Salesforce Request node
    Connecting to Salesforce from IBM App Connect Enterprise
    Salesforce connection details
    Salesforce policy

    I hope this helps.

    Steph.

    ------------------------------
    Stephanie Strugnell

    ------------------------------



  • 4.  RE: Using the Salesforce Request node

    Posted Tue January 24, 2023 07:54 AM
    Thanks for the feedback.

    I've managed to define a Connected App, but I don't see where Salesforce provides me with the Consumer Key and consumer secret (as promised by point 4 of the documentation at:  https://www.ibm.com/docs/en/app-connect/12.0?topic=discovery-configuring-secure-connection-salesforcecom-no):



    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 5.  RE: Using the Salesforce Request node

    Posted Tue January 24, 2023 09:42 AM
    Hi Peter,

    If you open the Create menu under the Build stanza on the left side bar in Salesforce and then click Apps you should then see the Connected App that you defined. If you then click on the Connected App Name link (not the Edit or Manage options) then your App should be displayed and you should also see a [Manage Consumer Details] button which you can click to see the Consumer Key and Secret.

    Hope that helps.

    Greg

    ------------------------------
    Greg Hatt
    ------------------------------



  • 6.  RE: Using the Salesforce Request node

    Posted Tue January 24, 2023 12:33 PM
      |   view attached
    Hi Peter,

    Attaching a short video as well in case that helps.


    ------------------------------
    [Fiona] [Davies]
    [IBM]
    London
    ------------------------------



  • 7.  RE: Using the Salesforce Request node

    Posted Wed January 25, 2023 06:47 AM
    Hi Greg, Fiona

    Thanks for the info and the video.

    I have managed to get the Consumer Key and Secret now.

    Sorry to ask yet again, but I know almost nothing about Salesforce:

    I'm trying to set up the "Discovery Connector - Using the Salesforce Request node" tutorial in ACE 12.0.7. 

    I launched the Connector Discovery, selected Contacts, Retrieve contacts and entered what I thought are the correct values for:

    Login URL  (I can use this URL to access SF successfully)
    Username (I can use this  username to access SF successfully)
    Password (I can use this password to access SF successfully)
    Client ID (derived from your very helpful posts)
    Client secret (derived from your very helpful posts)

    I click Connect and get an error as follows:


    Can you assist?

    Thanks in advance
    Peter



    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 8.  RE: Using the Salesforce Request node

    Posted Wed January 25, 2023 07:37 AM
    Another piece of info:

    On https://www.ibm.com/docs/en/app-connect/12.0?topic=discovery-configuring-secure-connection-salesforcecom-no

    the doc says in Step 2(f):

    'Set the Selected OAuth scopes to Access and manage your data (api).'

    I don't see an option like that under "Selected OAuth scopes", so I set it as follows:

    Is this OK?





    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 9.  RE: Using the Salesforce Request node

    Posted Wed January 25, 2023 01:54 PM
    Hi Peter,

    Glad to hear you were able to locate the Consumer Key and Secret.

    In my case, I only have Full access (full) in my list of Selected OAuth Scopes and I am able to connect to Salesforce with the SalesforceRequest node to perform discovery. I see you also have this scope selected so I would think that's ok.

    Just to confirm, when you entered the Password did you suffix it with your Salesforce Security Token? I only ask because that's something I have forgotten to do in the past.

    Greg

    ------------------------------
    Greg Hatt
    ------------------------------



  • 10.  RE: Using the Salesforce Request node

    Posted Wed January 25, 2023 01:58 PM
    Edited by fionadav EC2B Wed January 25, 2023 03:01 PM
    Hi Peter,

    The value required in the Password field has to be the password for your Salesforce account, suffixed with your Salesforce security token. If you check the  email account that you specified when provisioning your Salesforce instance, you should have an email from Salesforce titled "Your new Salesforce security token".  You should append the security token in this email to the actual password that you use to log in to your Salesforce instance - this is the value required in the Password field e.g. 

    mySalesforcePasswordSecurityTokenValue

    It's worth noting that each time you change your Salesforce password (typically every 3 months), you'll receive an email from Salesforce with a new security token for that password. This will also mean that you will need to update the Password field with the new password/security token value.

    HTH,

    Fiona

    ------------------------------
    [Fiona] [Davies]
    [IBM]
    London
    ------------------------------



  • 11.  RE: Using the Salesforce Request node

    Posted Thu January 26, 2023 03:31 AM
    Hi Greg, Fiona

    Thanks for the tip.

    Sorry to be a pain, but I don't see any token. I checked for emails from when I created the SF instance, but I don't see any email that gives me a token.

    I reset my password in the hope that this would generate a new token, but I have not received any email with a new token.

    I did see an item that says if you specify a restricted IP range for logging in to SF, then you won't be able to use a token. Or am I misunderstanding this?

    Regards
    Peter


    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 12.  RE: Using the Salesforce Request node

    Posted Thu January 26, 2023 04:19 AM
    Edited by fionadav EC2B Thu January 26, 2023 04:31 AM
    Hi Peter,

    Yes, the Salesforce docs do say this:

    Unable to see the Reset Security Token option
    Publish Date: 23 Feb 2022
    Description
    Customers may experience the inability to view "reset my security token" when Login IP Range sets are in place in the users or user admins profile.

    Profile Login IP range sets must be removed for visibility to appear.
    ...

    https://help.salesforce.com/s/articleView?id=000386179&type=1

    One of the resolutions in that doc is:

    In order for the Reset My Security Token option to appear you will need to remove the Login IP Ranges or change the User to a profile that does not have Login IP Ranges listed.

    You might want to try that and then try to reset your security token



    You could try creating another user profile and then log in as that user (with no IP ranges set) to see whether that enables you to obtain a security token.



    ------------------------------
    [Fiona] [Davies]
    [IBM]
    London
    ------------------------------



  • 13.  RE: Using the Salesforce Request node

    Posted Thu January 26, 2023 06:27 AM
    Hi Fiona

    I've checked that I don't have an IP address range specified.

    I also checked the link to the help doc that you gave me.

    I still can't see a Reset Security Token option, so I've opened a problem ticket with Salesforce.

    Thanks & regards
    Peter

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 14.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 03:36 AM
    Hi

    For some reason, I now see an option to Reset Security Token from the first account that I set up (don't ask me why!).

    I appended the token to my password and tried the Connector Discovery again.

    I get:


    However, when I click on Contacts (as per the "Using the Salesforce Request node" tutorial in ACE 12.0.7) I get the same error message that I posted in Post 7 above).

    Does the screenshot I posted today constitute proof of successful connection to Salesforce?

    Regards
    Peter

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 15.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 04:15 AM
    Edited by fionadav EC2B Fri January 27, 2023 04:17 AM
    Hi Peter,

    It's great that you can now see the Reset Security Token option! Making progress slowly, but surely :)

    Having the account name displayed like this possibly indicates that there might be an issue with the account that was created.


    Perhaps @Greg Hatt can shed some light on this from an ACE V12 POV?

    ​​

    ------------------------------
    [Fiona] [Davies]
    [IBM]
    London
    ------------------------------



  • 16.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 05:44 AM

    Hi Peter,

    The Account label of {Salesforce}:Salesforce1 is expected and correct. The {Salesforce} part is the name of the Policy Project that you provided in the Discovery wizard and Salesforce1 is the name of the Policy in the Salesforce Policy Project that holds the account connection details.

    With that said, I'm not convinced you've successfully managed to connect to Salesforce if you're still getting an error when clicking on the 'twistie' to open the Contacts.

    In my case, when I have a successful connection to Salesforce and open the Contact twistie I see a list of actions that can be performed for Contacts, like this:



    ------------------------------
    Greg Hatt
    ------------------------------



  • 17.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 06:24 AM

    Hi Peter,

    A different approach to trying to establish whether you can successfully connect might be to use the 'Discovery Connectors policies and credentials' option which is available from the File/New menu.


    Selecting this will open the Manage Discovery Connector policies and credentials wizard.


    If you create a new Policy Project (say SalesforceAccounts) and then click Finish you should see the Manage Connector Policies and Credentials screen where you can scroll down and select Salesforce.

    You can then try the 'Connect' option and enter the credentials to see whether you can successfully connect to Salesforce. If the connection is successul you should see a popup message indicating the connection was successful.


    I hope that helps.

    Greg



    ------------------------------
    Greg Hatt
    ------------------------------



  • 18.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 08:02 AM
    Hi Greg

    I tried the method you suggested. I also deleted all credentials from my vault for the Integration Server and restarted the Connector Discovery for the node in the Tutorials project.

    For both methods, I now get:

     

    Do you know where I can find the "errorDetail field of the log" ?

    Regards
    Peter

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 19.  RE: Using the Salesforce Request node

    Posted Fri January 27, 2023 08:55 AM

    Hi Peter,

    How frustrating!

    There's a configuration option to capture error information from Connector Discovery which you can access from the Window/Preferences menu and then select Connection Settings under the Integration Development twistie. I think this option defaults to write Error level messages to the .meta data directory in your Eclipse workspace so it's worth checking whether you have anything in that file which might provide some indicators as to what's wrong.



    If it's not on by default then I'd suggest turning it on with a Log Level of error and specify a file to write to and then recreate the issue.

    There will hopefully be some clues in the log file as to what the problem might be but if you're still struggling I'd suggest opening a support ticket and attaching this error log and hopefully the Service team can help you make progress.

    Hope that helps.

    Greg



    ------------------------------
    Greg Hatt
    ------------------------------



  • 20.  RE: Using the Salesforce Request node

    Posted Tue February 07, 2023 05:15 AM
    Hi Greg, Fiona

    Apologies for the radio silence - I had to focus elsewhere for a few days!

    On returning to my issue, I now (somewhat worryingly) get a new message. even though I have not consciously changes any parameters (!):



    Without stating the obvious, it looks like I need the Developer edition in order to progress. Is the Developer edition a chargeable item?

    Thanks & regards
    Peter

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 21.  RE: Using the Salesforce Request node

    Posted Wed February 08, 2023 01:12 AM
    Edited by fionadav EC2B Wed February 08, 2023 01:50 AM
    Hi Peter, 

    No worries!

    By default, API access is only allowed on Enterprise, Developer, Unlimited, and Performance editions. Professional edition does not come with free API access, and you might need to pay to enable the API access or upgrade to a higher edition.

    The Connecting to Salesforce from IBM App Connect Enterprise topic in the ACE 12 docs provides a link to the Salesforce Developers site where you can create a free account that is enabled for API access. (The Browse Trials button in the banner should take you to this page and you can sign up for the Salesforce Developer Edition from there.)



    HTH,
    Fiona

    ------------------------------
    Fiona Davies
    [IBM]
    London
    ------------------------------



  • 22.  RE: Using the Salesforce Request node

    Posted Thu February 09, 2023 04:04 AM
    Edited by Peter Von Hirschfeld Thu February 09, 2023 04:04 AM

    Hi Fiona, Greg

    I finally got it working.

    I set up a Developer account and then tried the Connector Discovery again.

    My first response was, once again:

    I then deleted all Salesforce credentials from my test vault and restarted the Connector Discovery.

    I then managed to connect and run a flow that does a RETRIEVEALL of my test data.

    I'm not sure why I initially got the API_DISABLED_FOR_ORG message again, though.

    I'm posting this detail in the hope that this might help others who are struggling to establish Salesforce connectivity.

    Once again, thanks for your really helpful posts over the last few weeks.

    Regards

    Peter 

    ------------------------------
    Peter Von Hirschfeld
    ------------------------------



  • 23.  RE: Using the Salesforce Request node

    Posted Thu February 09, 2023 04:14 AM

    It's good to see that you finally got this working, @Peter Von Hirschfeld ! Happy to help.

    Regards,

    Fiona



    ------------------------------
    Fiona Davies
    [IBM]
    London
    ------------------------------