Search code examples
phplinkedin-api

linkedin ANetAuthException nonMember


I have problem using api http://code.google.com/p/simple-linkedinphp/ for posting message in Linkedin groups.

With this request:

$OBJ_linkedin = new LinkedIn($API_CONFIG);
$response = $OBJ_linkedin->createPost(  "IDGROUP" ,   "title test",  "message test");

I receive this response:

<error>
   <status>403</status>
   <timestamp>1369732087697</timestamp>
   <request-id>NNPMM1EN5E</request-id>
   <error-code>0</error-code>
   <message>com.linkedin.anet.auth.pub.ANetAuthException: nonMember: anetID=IDGROUP </message>
<error>

I replace correctly IDGROUP with the group ID and also AppKey and AppSecret are correct.


Solution

  • You have to set the access token before making the api call.

    $OBJ_linkedin->setTokenAccess(array("oauth_token" => $oauth_token, 
                                 "oauth_token_secret" => $oauth_token_secret));