开发者

LinkedIN - PHP Sample Code

I am trying to implement the LinkeIN API with PECL oAuth Module, I have managed to import my contacts and the scrip works well o开发者_运维问答n my Development envoirnment

But on my Live Server it raises an exception when I get redirected to my website after authentication(From Linked In Website)

I have confirmed the following: 1. The TimeZone is proper and My Server DateTime is set correct. 2. The CallBack URL is proper

Exception : Exception caught! Response: 400 1302008612531 0 Unsupported POST target {/v1/people/~:(id,first-name,last-name,headline,location,industry,distance,relation-to-viewer,current-status,current-status-timestamp,connections,summary,specialties,proposal-comments,honors,positions,educations,member-url-resources,picture-url,site-standard-profile-request,api-standard-profile-request)} Fatal error: Uncaught exception 'OAuthException' with message 'Invalid auth/bad request (got a 400, expected HTTP/1.1 20X or a redirect)' in /var/www/html/contaxz/app/webroot/linkedIn/linkedin/Request.php:217 Stack trace: #0 /var/www/html/contaxz/app/webroot/linkedIn/linkedin/Request.php(217): OAuth->fetch('https://api.lin...') #1 /var/www/html/contaxz/app/webroot/linkedIn/example/index.php(23): LinkedIn_Request->pullConnections() #2 {main} thrown in /var/www/html/contaxz/app/webroot/linkedIn/linkedin/Request.php on line 217

Please suggest

Thanks Ravi


I had been breaking my head with the code, server configuration, oAuth installation, php and apache version, TimeZone and what not.... but had No Luck….

Finally, I found my way and thought of posting it here as it could help someone:

  1. Stop Apache
  2. Hunted for the PHP OAuth Module in the PHP lib directory in my case I found this at /usr/lib/php/modules/oauth.so
  3. Copied PHP OAuth Module from my DEV server and uploaded it on LIVE server
  4. Restarted apache and it worked!

Thanks Ravi

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜