Joomla Platform  13.1
Documentation des API du framework Joomla Platform
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JLinkedinCommunications
+ Graphe d'héritage de JLinkedinCommunications:
+ Graphe de collaboration de JLinkedinCommunications:

Liste de tous les membres

Fonctions membres publiques

 inviteByEmail ($email, $first_name, $last_name, $subject, $body, $connection= 'friend')
 inviteById ($id, $first_name, $last_name, $subject, $body, $connection= 'friend')
 sendMessage ($recipient, $subject, $body)
- Fonctions membres publiques inherited from JLinkedinObject
 __construct (JRegistry $options=null, JHttp $client=null, JLinkedinOAuth $oauth=null)
 booleanToString ($bool)
 getOption ($key)
 setOption ($key, $value)

Additional Inherited Members

- Attributs protégés inherited from JLinkedinObject
 $options
 $client
 $oauth

Description détaillée

Définition à la ligne 19 du fichier communications.php.


Documentation des fonctions membres

JLinkedinCommunications::inviteByEmail (   $email,
  $first_name,
  $last_name,
  $subject,
  $body,
  $connection = 'friend' 
)

Method used to invite people.

Paramètres:
string$emailA string containing email of the recipient.
string$first_nameA string containing frist name of the recipient.
string$last_nameA string containing last name of the recipient.
string$subjectThe subject of the message that will be sent to the recipient
string$bodyA text of the message.
string$connectionOnly connecting as a 'friend' is supported presently.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 35 du fichier communications.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base.
$base = '/v1/people/~/mailbox';
// Build the xml.
$xml = '<mailbox-item>
<recipients>
<recipient>
<person path="/people/email=' . $email . '">
<first-name>' . $first_name . '</first-name>
<last-name>' . $last_name . '</last-name>
</person>
</recipient>
</recipients>
<subject>' . $subject . '</subject>
<body>' . $body . '</body>
<item-content>
<invitation-request>
<connect-type>' . $connection . '</connect-type>
</invitation-request>
</item-content>
</mailbox-item>';
$header['Content-Type'] = 'text/xml';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinCommunications::inviteById (   $id,
  $first_name,
  $last_name,
  $subject,
  $body,
  $connection = 'friend' 
)

Method used to invite people.

Paramètres:
string$idMember id.
string$first_nameA string containing frist name of the recipient.
string$last_nameA string containing last name of the recipient.
string$subjectThe subject of the message that will be sent to the recipient
string$bodyA text of the message.
string$connectionOnly connecting as a 'friend' is supported presently.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 94 du fichier communications.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'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.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'GET', $parameters, $data);
if (strpos($response->body, 'apiStandardProfileRequest') === false)
{
throw new RuntimeException($response->body);
}
// Get header value.
$value = explode('"value": "', $response->body);
$value = explode('"', $value[1]);
$value = $value[0];
// Split on the colon character.
$value = explode(':', $value);
$name = $value[0];
$value = $value[1];
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base.
$base = '/v1/people/~/mailbox';
// Build the xml.
$xml = '<mailbox-item>
<recipients>
<recipient>
<person path="/people/id=' . $id . '">
</person>
</recipient>
</recipients>
<subject>' . $subject . '</subject>
<body>' . $body . '</body>
<item-content>
<invitation-request>
<connect-type>' . $connection . '</connect-type>
<authorization>
<name>' . $name . '</name>
<value>' . $value . '</value>
</authorization>
</invitation-request>
</item-content>
</mailbox-item>';
$header['Content-Type'] = 'text/xml';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}
JLinkedinCommunications::sendMessage (   $recipient,
  $subject,
  $body 
)

Method used to send messages via LinkedIn between two or more individuals connected to the member sending the message..

Paramètres:
mixed$recipientA string containing the member id or an array of ids.
string$subjectThe subject of the message that will be sent to the recipient
string$bodyA text of the message.
Renvoie:
array The decoded JSON response
Depuis:
13.1

Définition à la ligne 180 du fichier communications.php.

{
$token = $this->oauth->getToken();
// Set parameters.
$parameters = array(
'oauth_token' => $token['key']
);
// Set the success response code.
$this->oauth->setOption('success_code', 201);
// Set the API base.
$base = '/v1/people/~/mailbox';
// Build the xml.
$xml = '<mailbox-item>
<recipients>';
if (is_array($recipient))
{
foreach ($recipient as $r)
{
$xml .= '<recipient>
<person path="/people/' . $r . '"/>
</recipient>';
}
}
$xml .= '</recipients>
<subject>' . $subject . '</subject>
<body>' . $body . '</body>
</mailbox-item>';
$header['Content-Type'] = 'text/xml';
// Build the request path.
$path = $this->getOption('api.url') . $base;
// Send the request.
$response = $this->oauth->oauthRequest($path, 'POST', $parameters, $xml, $header);
return $response;
}

La documentation de cette classe a été générée à partir du fichier suivant :