SalesForce Integration with Drupal Site

SalesForce Integration with Drupal Site
Like Tweet Pin it Share Share Email

Salesforce provides api to integration with any other web and mobile applications. So that by OAuth service through connected app the salesforcce account authorize the account and establish the connection so that through the API’s we can perform action from any other applications.


Here I will tell you the steps to integrate your application with your Salesforce account, so that you can Push/Pull and Sync your data in either way. Salesforce provide a api services to have a connection with your external application, after authorise your account you can perform any action. All you need to do create a Connected app in Salesforce site, create a trial account with https://www.login.salesforce.com endpoint. There you need to create an account, then after login you will be landed in a page.


In top right you have ‘Setup’ link click this you will be redirected to another page, ther you can see a ‘Create Apps’ link in left side bar, expand this there you can see another link called ‘Apps’, click this you will get an another UI , in bottom of the main content area you have a connected apps section there you will have a New button to create a new connected app. Through this app only you will be authenticated by providing the credentials of the newly created app.


When you creating your app, you need to give your connected app name, api_name this should be formal name. Then your contact mail id, so that verification will be sent to your registered mail Id. Then you need to enable API OAuth connection , just enable the checkbox, then you need to add your callback url in this field, please make sure your callback url should have “https:// “ enabled one. I will tell you about this later just follow what you have seen in the screenshot. After that you need to select the two option this enough to request for all the Pull/Push and Sync serivces between the two applications.


After providing your app details click the submit button, your app will created and you will be redirected to setup page or else you can click the “setup” link in top right. Then expand the “Create apps” link -> Apps click the apps link then you will get a like the below scrennshot.


Click on the app name,there you can see the page with basic information of your app with credentials. In the second section Api, you will have a Consumer key and Consumer Secret string (by clicking click to reveal link you can get a Key) make note of this Consumer Key and Secret string credentials, this only you need to add in your application so that request/response will happen on behalf you. Thats all in SalesForce application side.


Drupal Setup,

Create a drupal setup in your machine, then install all your preferred modules. Then Install the Salesforce contributed module which will be available in https://www.drupal.org/project/salesforce. Download this module and put into the ‘sites/all/modules’ folder and download the Salesforce Library too and put this into sites/all/libraries. Then go to your module page enable all the modules.


After that, you need to authorize your Salesforce in Configuration >> SalesForce, this will give you an UI to enter your connected app credentials which you have collected already, refer this below screenshot.


Once you make sure about your app credentials, click the authorize button , then you will be redirected to your Salesforce page there you need to login your account for the first time. Once your app verified in either side you will get like the below screenshot.

*Note : Your drupal site end url should be the same one which we added as a Oauth callback url’s Base Url in Salesforce account. (For ex. There we added https://localhost/drupalsite/salesforce/oauth_callback so your drupal site base url should https://localhost/drupalsite).


Once your Salesforce authroized with your application, then you have to map your drupal field with Salesforce Object. Go to Structure >> Salesforce >> Salesforce Mapping , you have a linkn to add mapping. Add mapping with your drupal field with Salesforce object, so refer below screenshot. There I have create a mapping our Drupal User entity to Salesforce Account object, in drupal we call it as entity like that in Salesforce we used to call it there as a object.


So once your mapping is over, create a new User account in drupal site, through the mapping your newly created data is push into Salesforce. Likewise you can have a option to pull and sync your drupal data with Salesforce account.


Likewise we can integrate Salesforce with any other Web/Mobile application with Salesforce API services. If you need any clarifications in this tutorial comment here will try to solve the issue. Thank you !!

Comments (3)

Speak Your Mind