Source for file communications.php
Documentation is available at communications.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
defined('JPATH_PLATFORM') or die();
* Linkedin API Social Communications class for the Joomla Platform.
* @package Joomla.Platform
* Method used to invite people.
* @param string $email A string containing email of the recipient.
* @param string $first_name A string containing frist name of the recipient.
* @param string $last_name A string containing last name of the recipient.
* @param string $subject The subject of the message that will be sent to the recipient
* @param string $body A text of the message.
* @param string $connection Only connecting as a 'friend' is supported presently.
* @return array The decoded JSON response
public function inviteByEmail($email, $first_name, $last_name, $subject, $body, $connection =
'friend')
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
// Set the success response code.
$this->oauth->setOption('success_code', 201);
$base =
'/v1/people/~/mailbox';
<person path="/people/email=' .
$email .
'">
<first-name>' .
$first_name .
'</first-name>
<last-name>' .
$last_name .
'</last-name>
<subject>' .
$subject .
'</subject>
<body>' .
$body .
'</body>
<connect-type>' .
$connection .
'</connect-type>
$header['Content-Type'] =
'text/xml';
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
* Method used to invite people.
* @param string $id Member id.
* @param string $first_name A string containing frist name of the recipient.
* @param string $last_name A string containing last name of the recipient.
* @param string $subject The subject of the message that will be sent to the recipient
* @param string $body A text of the message.
* @param string $connection Only connecting as a 'friend' is supported presently.
* @return array The decoded JSON response
public function inviteById($id, $first_name, $last_name, $subject, $body, $connection =
'friend')
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
// Set the API base for people search.
$base =
'/v1/people-search:(people:(api-standard-profile-request))';
$data['format'] =
'json';
$data['first-name'] =
$first_name;
$data['last-name'] =
$last_name;
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'GET', $parameters, $data);
if (strpos($response->body, 'apiStandardProfileRequest') ===
false)
throw
new RuntimeException($response->body);
$value =
explode('"value": "', $response->body);
// Split on the colon character.
// Set the success response code.
$this->oauth->setOption('success_code', 201);
$base =
'/v1/people/~/mailbox';
<person path="/people/id=' .
$id .
'">
<subject>' .
$subject .
'</subject>
<body>' .
$body .
'</body>
<connect-type>' .
$connection .
'</connect-type>
<name>' .
$name .
'</name>
<value>' .
$value .
'</value>
$header['Content-Type'] =
'text/xml';
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
* Method used to send messages via LinkedIn between two or more individuals connected to the member sending the message..
* @param mixed $recipient A string containing the member id or an array of ids.
* @param string $subject The subject of the message that will be sent to the recipient
* @param string $body A text of the message.
* @return array The decoded JSON response
public function sendMessage($recipient, $subject, $body)
$token =
$this->oauth->getToken();
'oauth_token' =>
$token['key']
// Set the success response code.
$this->oauth->setOption('success_code', 201);
$base =
'/v1/people/~/mailbox';
foreach ($recipient as $r)
<person path="/people/' .
$r .
'"/>
<subject>' .
$subject .
'</subject>
<body>' .
$body .
'</body>
$header['Content-Type'] =
'text/xml';
// Build the request path.
$response =
$this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
Documentation generated on Tue, 19 Nov 2013 14:56:08 +0100 by phpDocumentor 1.4.3