Hi Everyone,We've noticed that there are still some people having trouble using the PHP OAuth library at http://oauth.googlecode.com/svn/code/php/This is a great library as it has very few dependencies for you to work out.I spent some time today writing some very basic examples for walking through the OAuth authorization flow (in out of band mode), requesting your own profile, and setting your status using this API.Attached to this message you'll find a ZIP with a few files:
- linkedin.php - boiler plate code to interface with API. Contains the OAuth hooks and some basic functions for profile and status. Easy to extend further. No XML interpretation or persistence supplied.
- testLinkedinOauth.php - an example script for working with linkedin.php -- supply your keys to this, and execute the script on the command line.
- It will perform the requestToken step, then present you with an authorization URL for you to copy & paste into your browser.
- Then go through the login flow and you'll be presented with the oauth_verifier PIN code. Copy this.
- Back to the PHP script, it'll prompt you for the oauth_verifier, paste it in.
- Now the script will request the XML for your profile, and also set your LinkedIn status to "setting my status with the LinkedIn API
- testWithAcessToken.php - an example script just like the one above, except it allows you to use a pre-prepared access token and secret
- A recent version of the OAuth library this is all based on
I hope this helps you PHP developers! A caveat: I'm not a native speaker of PHP, so my apologies for the lack of idiomatic code.Thanks,Taylor
LinkedInOauth-PHP-WithSearch.zip
- Log in to post comments
Is there a way to grab individual fields from the output array?For example, if a profile has let's say 2 educational institutions...how could I grab both instances (institution, start, end dates, etc.) individually?Same would go for past jobs/projects.