Integration with LinkedIn.com Part 2

In a previous article we took an initial look at how a business-oriented community website can benefit from integrating with LinkedIn.com, outlining the steps necessary to utilize the LinkedIn API and OAuth to do this. Now we’ll look more deeply at the achievement of integration and the ability to allow your users to invite LinkedIn members directly to your website. The library that we are using and that we referred to in our previous artcle, is this one.

So, again, this integration task consists of two parts: first, the user must search for a friend whom they wish to invite to your site and then the invitation must be sent.

1. The search function is outlined very well in the LinkedIn API documentation so we’ll skip here directly to a simple example in order to highlight the most important features:

//searching of all friends named Ann
 
$search_response = $linkedin->search("?facets=network&facet=network,F&first-name=Ann");
 
$xml = simplexml_load_string($search_response);
 
foreach($xml->people->person as $person)
{
print_r($person);
}

Take special note:

  • All parameters of a search inquiry are connected with logical AND.

2. Unfortunately LinkedIn does not allow us to detect the email address of a user but invitations can be sent via LinkedIn’s on-site messaging system. While the API will allow us to send on-site messages, the feature is not implemented in the linkedin.php library which we’ve loaded and so we’ll need to modify a bit. Add this code into the file linkedin.php:

  • WildCard is not supported.
  • If a search returns too many results you are able to narrow them done using the “total” parameter in the returned XML:
base_url . "/v1/people/~/mailbox";
$request = OAuthRequest::from_consumer_and_token($this->consumer, $this->access_token, "POST", $send_url);
$request->sign_request($this->signature_method, $this->consumer, $this->access_token);
$auth_header = $request->to_header("https://api.linkedin.com");
 
if ($this->debug) {
echo $request->get_signature_base_string() . "\n";
echo $auth_header . "\n";
}
 
$raw_xml = "
 
  $subj
  $msg
";
$status = 0;
$response = $this->httpRequest($send_url, $auth_header, "POST", $raw_xml, $status);
 
return $status;
}
?>

Now the code to send the message will look like this:

//$id_rec - id recipient in LinkedIn.
$send_response = $linkedin->sendMessage($id_rec, 'Subject', 'Message body');
 
if($send_response == 201)
{
//Message sended
}
else
{
//Error handling
}
This entry was posted in PHP Tips.

252 Responses to Integration with LinkedIn.com Part 2

  1. Virgie Vehrs says:

    I am developing a blog and and i want to change the theme.Yours looks pretty decent! You could visit my website and tell me your opinion!

  2. The most difficult thing is to find a blog with unique and fresh content but your posts are not alike. Bravo.

  3. Crazyupload says:

    I will post a link to this page on my blog.
    Thanks!

  4. your ex back says:

    Hello Im Richard ,Have been a tea fanatic, really like the aroma and the taste of tea as the primary thing after waking up. I drink atleast eight cups every single day. By the way nice blog, Have a nice day.

  5. I keep listening to the news update lecture about receiving boundless online grant applications i really happen to be shopping for the top site to get one. Could you advise me please, where could i buy some?

  6. I dont completely get the hang of your view, but I get the point.

  7. There is noticeably a bunch to identify about this. I consider you made some good points in features also.

  8. click here says:

    You are a very capable person!

  9. click here says:

    There is obviously a bundle to identify about this. I assume you made various good points in features also.

  10. sniper games says:

    Dude! This blog is amazing.

  11. kangen water says:

    I noticed something as well about this on different blog.Interesting, your view on it is diametrically opposite to what I read before. I am still trying to figure out over the conflicting points of view, but I’m tipped heavily toward your point of view. And in any case, that’s what is so splendid about contemporary democracy and the marketplace of thoughts on-line.

  12. lip plumping says:

    You made some decent points there. I did a search on the topic and found most people will approve with your website.

  13. Frank John says:

    I really love reading your blog, it is actually one of the highlights of my week. I particularly enjoy reading it during my lunch break.

  14. Tea says:

    i’m adding your blog’s rss feed so that I can see your new posts. Keep up the good work!

  15. I don’t even know how I ended up here, but I thought this post was interesting. Cheers!

  16. Hi there! This is my first comment here so I just wanted to give a quick shout out and tell you I really enjoy reading through your articles. Can you suggest any other blogs/websites/forums that cover the same topics? Thanks a lot!

  17. I wanted to thank you for this interesting I definitely loved every little bit of it. I have you bookmarked your web site to check out the latest stuff you post.

  18. Admiring the commitment you put into your blog and detailed information you present. It’s good to come across a blog every once in a while that isn’t the same unwanted rehashed material. Wonderful read! I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.

  19. Wow this is a great resource.. I’m enjoying it.. good article

  20. I want to convey my passion for your kind-heartedness for people that really want assistance with this question. Your real dedication to getting the message up and down ended up being certainly insightful and have in every case helped ladies much like me to realize their pursuits. Your amazing valuable guide indicates a lot to me and further more to my peers. Best wishes; from each one of us.

  21. I be subjected to winding up vanquish to your blog innumerable times. The added articles are incredibly captivating and interesting. I unswerving to signup payment your rss grant-in-aid, so I can secure keeping in the departmentalize of your concomitant editorials.

  22. Insurance says:

    WONDERFUL Post.thanks for share..extra wait .. …

  23. This really answered my problem, thank you!

  24. I truly like the fresh perpective you did on the problem. Truly was not expecting that when I started off studying. Your concepts were easy to comprehend that I wondered why I never looked at it before. Glad to know that there’s an individual out there that definitely understands what he’s discussing. Fantastic job

  25. *When I originally commented I clicked the -Notify me when new comments are added- checkbox and now each time a comment is added I get four emails with the same comment. Is there any way you can remove me from that service? Thanks!

  26. we will go back to the 1990s where you had to pay for each byte downloaded.

  27. So where are all these jobs that the cuts are supposed to create? Are the millionaires spending their current extra 3% to create jobs

  28. Top post. I look forward to reading more. Cheers – 30000

  29. Its such as you learn my mind! You seem to understand a lot about this, like you wrote the book in it or something. I believe that you simply can do with some % to drive the message home a little bit, but instead of that, that is excellent blog. A fantastic read. I’ll certainly be back.

  30. Your place is valueble for me. Thanks!

  31. Maximo Sauro says:

    Excellent article and easy to understand explanation. How do I go about getting permission to post part of the article in my upcoming news letter? Giving proper credit to you the author and link to the site would not be a problem.

  32. I am Glad i came across this blog.Added it to my bookmark!

  33. Flange says:

    Thanks for sharing!!!

  34. As a fellow professional from the fashion marketplace, I found your internet web site to be educational. I’ve usually been in value with trend all my lifestyle so I’ve produced a forum for marketplace experts to come collectively and discuss all issues trend. I’ve gained a couple great suggestions for my world-wide-web web page from studying this

  35. Smart stuff, I look forward to reading even more.

  36. Resa says:

    i’ve visited this cool site a few times now and i have to tell you that i find it quite nice actually. continue doing what you’re doing! ;)

  37. Noemi Simank says:

    added this to digg

  38. Pingback: Alexander1

  39. Pingback: Alexander6

  40. Pingback: Alexander7

  41. Pingback: STEVEN

  42. Pingback: LEWIS

  43. Pingback: ENRIQUE

  44. Pingback: EDUARDO

  45. Pingback: TERRENCE

  46. Pingback: SALVADOR

  47. Pingback: RONNIE

  48. Pingback: ROY

  49. Pingback: PERRY

  50. Pingback: DUSTIN

  51. Pingback: BRANDON

  52. Pingback: RICARDO

  53. Pingback: TRACY

  54. Pingback: RUSSELL

  55. Pingback: SALVADOR

  56. Pingback: WALLACE

  57. Pingback: ARTHUR

  58. Pingback: GABRIEL

  59. Pingback: FRANKLIN

  60. Pingback: LESLIE

  61. Pingback: GUY

  62. Pingback: JEFFREY

  63. Pingback: DONALD

  64. Pingback: ALFRED

  65. Pingback: GARY

  66. Pingback: FELIX

  67. Pingback: WILLIE

  68. Pingback: LESLIE

  69. Pingback: TERRENCE

  70. Pingback: BYRON

  71. Pingback: SAM

  72. Pingback: RUBEN

  73. Pingback: BOB

  74. Pingback: BILLY

  75. Pingback: NATHAN

  76. Pingback: TED

  77. Pingback: CARL

  78. Pingback: ANGELO

  79. Pingback: RICARDO

  80. Pingback: BRUCE

  81. Pingback: ADAM

  82. Pingback: OLIVER

  83. Pingback: LLOYD

  84. Pingback: LUIS

  85. Pingback: CLIFTON

  86. Pingback: RAY

  87. Pingback: BERNARD

  88. Pingback: LAWRENCE

  89. Pingback: VICTOR

  90. Pingback: DARYL

  91. Pingback: RODNEY

  92. Pingback: SERGIO

  93. Pingback: JEREMIAH

  94. Pingback: MELVIN

  95. Pingback: BRUCE

  96. Pingback: MARION

  97. Pingback: JOEL

  98. Pingback: MITCHELL

  99. Pingback: JERRY

  100. Pingback: BRETT

  101. Pingback: GLENN

  102. Pingback: STEVEN

  103. Pingback: MARION

  104. Pingback: BRYAN

  105. Pingback: JOHNNY

  106. Pingback: LEWIS

  107. Pingback: VINCENT

  108. Pingback: MARVIN

  109. Pingback: BRUCE

  110. Pingback: EVAN

  111. Pingback: VINCENT

  112. Pingback: LEROY

  113. Pingback: MILTON

  114. Pingback: LOUIS

  115. Pingback: CARLOS

  116. Pingback: ALEX

  117. Pingback: AARON

  118. Pingback: NICHOLAS

  119. Pingback: SHANE

  120. Pingback: DWAYNE

  121. Pingback: ALVIN

  122. Pingback: NICK

  123. Pingback: JASON

  124. Pingback: RENE

  125. Pingback: RANDY

  126. Pingback: NATHAN

  127. Pingback: ENRIQUE

  128. Pingback: BRAD

  129. Pingback: KIRK

  130. Pingback: DARRYL

  131. Pingback: MELVIN

  132. Pingback: DEAN

  133. Pingback: JOSE

  134. Pingback: KEN

  135. Pingback: RUBEN

  136. Pingback: BARRY

  137. Pingback: REX

  138. Pingback: STEPHEN

  139. Pingback: GENE

  140. Pingback: CLINTON

  141. Pingback: AUSTIN

  142. Pingback: RICHARD

  143. Pingback: STEPHEN

  144. Pingback: JOHNNY

  145. Pingback: ALAN

  146. Pingback: BOB

  147. Pingback: gerard

  148. Pingback: EVERETT

  149. Pingback: JEFFERY

  150. Pingback: TYLER

  151. Pingback: JERRY

  152. Pingback: JAMES

  153. Pingback: MARION

  154. Pingback: EDWIN

  155. Pingback: EDWIN

  156. Pingback: FREDDIE

  157. Pingback: EUGENE

  158. Pingback: TIMOTHY

  159. Pingback: RAY

  160. Pingback: RONNIE

  161. Pingback: GREG

  162. Pingback: ALBERT

  163. Pingback: ZACHARY

  164. Pingback: TRAVIS

  165. Pingback: TODD

  166. Pingback: ALAN

  167. Pingback: MATT

  168. Pingback: EDWIN

  169. Pingback: CHRIS

  170. Pingback: HERMAN

  171. Pingback: ANTONIO

  172. Pingback: PEDRO

  173. Pingback: BRYAN

  174. Pingback: LEO

  175. Pingback: MARK

  176. Pingback: TRAVIS

  177. Pingback: HENRY

  178. Pingback: DERRICK

  179. Pingback: HUBERT

  180. Pingback: LESLIE

  181. Pingback: MILTON

  182. Pingback: IVAN

  183. Pingback: BARRY

  184. Pingback: GORDON

  185. Pingback: ZACHARY

  186. Pingback: NATHAN

  187. Pingback: ANDRE

  188. Pingback: JOSHUA

  189. Pingback: KEN

  190. Pingback: HOMER

  191. Pingback: CODY

  192. Pingback: LAWRENCE

  193. Pingback: JEFF

  194. Pingback: WALTER

  195. Pingback: KYLE

  196. Pingback: PERRY

  197. Pingback: BEN

  198. Pingback: KENNY

  199. Pingback: ALEX

  200. Pingback: WALLACE

  201. Pingback: TERRENCE

  202. Pingback: DOUG

  203. Pingback: PETER

  204. Pingback: MARION

  205. Pingback: PETER

  206. Pingback: KIRK

  207. Pingback: KYLE

  208. Pingback: BRADLEY

  209. Pingback: ERIC

  210. Pingback: WARREN

  211. Pingback: JOEY

  212. Pingback: JEREMY

  213. Pingback: BYRON

  214. Pingback: RICARDO

  215. Pingback: FREDRICK

  216. Pingback: GUY

  217. Pingback: CHRIS

  218. Pingback: DALE

  219. Pingback: ALEJANDRO

  220. Pingback: CLIFTON

  221. Pingback: THEODORE

  222. Pingback: BRADLEY

  223. Pingback: WILLIAM

  224. Pingback: MICHAEL

  225. Pingback: JEREMIAH

  226. Pingback: NATHANIEL

  227. Pingback: CHARLIE

  228. Pingback: JIMMY

  229. Pingback: BRANDON

  230. Pingback: MICHEAL

  231. Pingback: LESLIE

  232. Pingback: FRANCIS

  233. Pingback: ENRIQUE

  234. Pingback: LUKE

  235. Pingback: FRED

  236. Pingback: LESTER

  237. Pingback: DAN

  238. Pingback: NATHAN

  239. Pingback: STEVE

  240. Pingback: ARTURO

  241. Pingback: VICTOR

  242. Pingback: STEVE

  243. Pingback: OSCAR

  244. Pingback: JIM

  245. Pingback: JIM

  246. Pingback: JORDAN

  247. Pingback: JOHN

  248. Pingback: GREGORY

  249. Pingback: JOEL

  250. Pingback: BRETT

  251. Pingback: JEREMY

  252. Pingback: HARRY

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">