function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Nagendra SinghNagendra Singh 

how to integrate LinkedIn With Salesforce

GarrettzGarrettz
Our team recently tried to get some sort of integration here. To my knowledge you have 3 options:

1. LinkedIn's Sales Navigator Product (https://business.linkedin.com/sales-solutions/products/sales-navigator) - not sure of the cost but comes with some bells and whistles as well as some visualforce pages which embed LinkedIn directly on your page
2. Salesforce for LinkedIn/LinkedIn Social Profile (I believe this was transistioned to LinkedIn Premium (https://premium.linkedin.com/)) - again cost associated with this. I believe this allows users to use the Salesforce Social Profiles to get access to LinkedIn.
3. Build an API with LinkedIn. This is most likely what you want as you can store the data in Salesforce. The problem is, LinkedIn sees this data as proprietary and don't share it too well. You'll need to pay a licensing cost along with building your own integration.
Nagendra SinghNagendra Singh
I am Trying this code but this is giving error....please give me solution for that, i think i am not geting 'Code'

Controller:
public class LinkedInIntegrationController {
 //Pass in the endpoint to be used
    final String redirect_uri = 'https%3A//www.sfclouds.com';
    final String scope = 'r_fullprofile%20r_emailaddress%20r_network';
    final String state = 'asjasjdj32423j324k23j2323jk23j';
    final String client_id = 'Apikry';
    final String client_secret = 'myclientScret';
    String code;
    String accessTokenURI;    
    public String body{get;set;}
    public String authorizationCodeURI{get;set;}
 
public LinkedInIntegrationController(){
 
 code = ApexPages.currentPage().getParameters().get('code');
        authorizationCodeURI = 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code'+'&client_id='+client_id+'&state='+state+'&redirect_uri='+redirect_uri;
                               
        code = ApexPages.currentPage().getParameters().get('code');                       
                               
        System.debug('----code---'+code);                      
                               
                              
       // if(code <> null)
       // {
            accessTokenURI = 'https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code'+'&code=' + code +'&redirect_uri='+redirect_uri+'&scope='+scope+ '&client_id=' + client_id + '&client_secret=' + client_secret;
                                                                                                                    
            HttpRequest req = new HttpRequest();
            req.setEndpoint(accessTokenURI);
            req.setMethod('POST');
            Http http = new Http();
            HTTPResponse res = http.send(req);
            body = res.getBody();
        //}
 }
 
}


VF Page:

<apex:page controller="LinkedInIntegrationController" >
<apex:form > <
apex:outputLink value="{!authorizationCodeURI}" target="blank">Authorize Me</apex:outputLink>
</apex:form>
</apex:page>
 
Divya GhodasaraDivya Ghodasara
when you get a code ...
Must be string variable declare with get set method
 String code;
replace with...
String code {get;set;}