title: LinkedIn API for share on profile
body: <p>I am using below code for share post on LinkedIn profile.</p>
  
  <pre><code>function share($comment, $title, $url, $imageUrl) {
            $shareUrl     =   $this-&gt;base_url . "/v1/people/~/shares";
  
            $xml = "&lt;share&gt;
                    &lt;comment&gt;$comment&lt;/comment&gt;
                    &lt;content&gt;
                       &lt;title&gt;$title&lt;/title&gt;
                       &lt;submitted-url&gt;$url&lt;/submitted-url&gt;
                       &lt;submitted-image-url&gt;$imageUrl&lt;/submitted-image-url&gt;
                    &lt;/content&gt;
                    &lt;visibility&gt;
                       &lt;code&gt;anyone&lt;/code&gt;
                    &lt;/visibility&gt;
                  &lt;/share&gt;";
  
            $request = OAuthRequest::from_consumer_and_token($this-&gt;consumer, $this-&gt;access_token, "POST", $shareUrl);
            $request-&gt;sign_request($this-&gt;signature_method, $this-&gt;consumer, $this-&gt;access_token);
            $auth_header = $request-&gt;to_header("https://api.linkedin.com");
            if ($debug) {
                echo $xml . "\n";
                echo $auth_header . "\n";
            }
            $response = $this-&gt;httpRequest($shareUrl, $auth_header, "POST", $xml);
            return $response;
        }
  </code></pre>
  
  <p>But I am getting this error:</p>
  
  <pre><code>{ "errorCode": 0, "message": "[unauthorized]. The token used in the OAuth request is not valid. consumerKey: 81zzkab8nsixp6", "requestId": "GILZJ3Q4MV", "status": 401, "timestamp": 1473170097823 }
  1{ "errorCode": 0, "message": "[unauthorized]. OAU:81zzkab8nsixp6|c89e142b-2525-487c-849d-eeaffca04b09|*01|*01:1473170099:V1l36ga90ipTNGKqmQ4OzUKxfoA=", "requestId": "8QWY8GGCCH", "status": 401, "timestamp": 1473170098235 }
  </code></pre>
  
  <p>Can anyone help to solve this error?</p>