title: Using oauth2_access_token to get connections in linkedIn
body: <p>I'm trying to get <strong>the connections in linkedIn using their API</strong>, but when I try to retrieve the connections  I get a 401 unauthorized error.</p>
  
  <p>in the official documentation says </p>
  
  <blockquote>
    <p>You must use an access token to make an <a href="http://developer.linkedin.com/documents/authentication" rel="nofollow noreferrer">authenticated call</a> on behalf
    of a user </p>
    
    <p><strong>Make the API calls</strong> You can now use this access_token to make API calls on behalf of this user by appending
    "oauth2_access_token=access_token" at the end of the API call that you
    wish to make.</p>
  </blockquote>
  
  <p>The API call that I'm trying to do is the following</p>
  
  <p>Error -->
  <a href="http://api.linkedin.com/v1/people/~/connections:(id,headline,first-name,last-name)?format=json&amp;oauth2_access_token=" rel="nofollow noreferrer">http://api.linkedin.com/v1/people/~/connections:(id,headline,first-name,last-name)?format=json&amp;oauth2_access_token=</a><strong>access_token</strong></p>
  
  <p>I have tried to do it with the following endpoint without any problems.</p>
  
  <p>OK --> <a href="https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,date-of-birth,industry,email-address,location,headline,picture-urls::(original))?format=json&amp;oauth2_access_token=" rel="nofollow noreferrer">https://api.linkedin.com/v1/people/~:(id,first-name,last-name,formatted-name,date-of-birth,industry,email-address,location,headline,picture-urls::(original))?format=json&amp;oauth2_access_token=</a><strong>access_token</strong> </p>
  
  <p>this list of endpoints for the connections API are described here
  <a href="http://developer.linkedin.com/documents/connections-api" rel="nofollow noreferrer">http://developer.linkedin.com/documents/connections-api</a>
  I just copied and pasted one endpoint from there, so the question is what's the problem with the endpoint for getting the connections? what am I missing?</p>
  
  <p>EDIT:
  for the preAuth Url I'm using</p>
  
  <p><a href="https://www.linkedin.com/uas/oauth2/authorization?response_type=code&amp;client_id=" rel="nofollow noreferrer">https://www.linkedin.com/uas/oauth2/authorization?response_type=code&amp;client_id=</a><strong>ConsumerKey</strong>&amp;scope=<strong>r_fullprofile%20r_emailaddress%20r_network&amp;state</strong>&amp;state=<strong>NewGuid</strong>&amp;redirect_uri=<strong>Encoded_Url</strong></p>
  
  <p><a href="https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&amp;code=" rel="nofollow noreferrer">https://www.linkedin.com/uas/oauth2/accessToken?grant_type=authorization_code&amp;code=</a><strong>QueryString_Code</strong>&amp;redirect_uri=<strong>EncodedCallback</strong>&amp;client_id=<strong>ConsummerKey</strong>&amp;client_secret=<strong>ConsumerSecret</strong></p>
  
  <p>please find attached the login screen requesting the permissions</p>
  
  <p><img src="https://i.stack.imgur.com/4iqAo.png" alt="enter image description here"></p>
  
  <p>EDIT2:
  Switched to https and worked like a charm!</p>