...
For a sample proxy service that illustrates how to work with user's network, see Sample configuration.
Operation | Description |
The Get Network Updates API returns the user's network updates, which is the LinkedIn term for the user's feed. | |
The Post Network Update API allows you to send in an activity from your site to be posted to the first degree connections of the LinkedIn user. | |
Network updates serve as one of the core experiences on LinkedIn, giving users the ability to share updates serve as one of the core experiences on LinkedIn, giving users the ability to share rich content to their professional network. |
...
This section provides details on each of the operations.
...
The Get Network Updates API returns the user's network updates, which is the LinkedIn term for the user's feed. This call returns most of what shows up in the middle column of the LinkedIn.com home page, either for the member or the member's connections.
| Code Block | ||||
|---|---|---|---|---|
| ||||
<linkedin.getNetworkUpdates>
<id>{$ctx:id}</id>
<type>{$ctx:type}</type>
<scope>{$ctx:scope}</scope>
<count>{$ctx:count}</count>
<start>{$ctx:start}</start>
<after>{$ctx:after}</after>
<before>{$ctx:before}</before>
<showHiddenMembers>{$ctx:showHiddenMembers}</showHiddenMembers>
<fieldSelectors>{$ctx:fieldSelectors}</fieldSelectors>
</linkedin.getNetworkUpdates> |
Properties
id:Optional - ID of the connection that updates will be retrieved from.type:Optional - Any valid Network Update type from the table below. Types must be in all capital letters. To specify more than one Network Update type, add the type parameter to the resource URL for each type.scope:Optional - Self to return member's feed. Omitted to return aggregated network feed.count:Optional - Number of updates to return, with a maximum of 250.start:Optional - The offset by which to start Network Update pagination.after:Optional - The timestamp after which to retrieve updates (e.g.: 1243834824000); note: precision is milliseconds since the epoch.before:Optional - The timestamp before which to retrieve updates (e.g.: 1243834824000); note: precision is milliseconds since the epoch.showHiddenMembers:Optional - true or false. Default is false. Whether to display updates from people the member has chosen to "hide" from the member's update stream.fieldSelectors:Field selectors are specified after the resource identifiers and path components of a resource, prefixed by a colon, contained within parentheses, and separated by commas. Fields will be returned in the order specified. When URL-encoding your resource URLs, ensure that the parentheses used in selectors remain unescaped. Remember, each field you select adds computation time to your API request. It's best to be very specific as to what fields you want returned in each API call you make.
Network update types
| Code | Update Type | Description |
|---|---|---|
| APPS | Application Update | An action that occurred in a partner application either by a connection or by an application itself. The contents of the update will be HTML entity encoded. Return types:
|
| CMPY | Company Follow Updates | A change to one of the companies the member is following. Return type:
|
| CONN | Connection Updates | These updates cover aspects of connections made on LinkedIn. They cover both the connecting user and the user's connections, making connections (second degree connections). Return types:
|
| JOBS | Posted a Job | A connection has posted a job posting on LinkedIn. Return type:
|
| JGRP | Joined a Group | A connection has joined a group. |
| PICT | Changed a Picture | A connection has updated the profile picture. Return type:
|
| PFOL | People Follow Updates | The authenticated user or one of the user's connections has started to follow another member. Currently, only LinkedIn Influencers can be followed. |
| PRFX | Extended Profile Update | A connection has updated the extended profile: personal information such as telephone number, IM account, and Twitter handle. Return type:
|
| RECU | Recommendations | A connection was recommended. Return types:
|
| PRFU | Changed Profile | A connection has updated the profile. This does not include picture updates, which are covered under the PICT type. The fields updated are returned in the XML. Since the first name, last name, and headline are always returned for each update, if those are the only fields you see, then you can assume that the change was to the headline. Return type:
|
| SHAR | Shared Item | A connection has shared an update or link. Return type:
|
...
Following is a sample REST request that can be handled by the getNetworkUpdates operation.
| Code Block | ||||
|---|---|---|---|---|
| ||||
{
"accessToken":"AQVJg6msJPuBpjIuXxzSO5W2C3Fn0ndN835PkwywMn33VKr6an_OPiKgPNiBxyOY1wY1ZgM__RLlX3yQ873WD6QqbBtf_n- rUTV8UBtjMeZiQHDzFsII2o7_PPv4mxOg8PgnMwxNieTzIzR9OTtVeoFSaWgHKbDLH5MfG29bRSLN1pdriwE",
"apiUrl":"https://api.linkedin.com",
"scope":"",
"id":"",
"count":"",
"type":"",
"start":"",
"before":"",
"after":"",
"showHiddenMembers":"",
"fieldSelectors":"timestamp,update-content:(person:(id,first-name))"
}
|
Related LinkedIn documentation
http://developer.linkedin.com/documents/get-network-updates-and-statistics-api
...
The sendActivity API allows you to send in an activity from your site to be posted to the first degree connections of the LinkedIn user.
| Code Block | ||||
|---|---|---|---|---|
| ||||
<linkedin.sendActivity>
<postBody>{$ctx:postBody}</postBody>
<contentType>{$ctx:contentType}</contentType>
</linkedin.sendActivity> |
Properties
postBody:The body of the update. The actual content of the update. You can use HTML to include links to the user name and the content the user created. Other HTML tags are not supported. All body text should be HTML entity escaped and UTF-8 compliant.contentType:Indicates that you may have a limited subset of HTML within the contents of your update.
Sample request
Following is a sample REST request that can be handled by the sendActivity operation.
| Code Block | ||||
|---|---|---|---|---|
| ||||
{
"apiUrl":"https://api.linkedin.com",
"accessToken":"AQUTLRduwpxckE9MFxpJhUt83CofHEUniIh9FMEAO50YrHCwxslBbMRc-KQCEeu9oiOUT86PsvkJzBVoLHqdDl7Iq2W7j8ku0kA- dmGAXECJgIjui6w4wggDgl_oGr5bskdCTt8LPKiGyUQ0hl1TrH6qOAqFHrE0qWuffFMaPv78yeTFtkE",
"contentType":"linkedin-html",
"postBody":"Hello World"
}
|
Related LinkedIn documentation
http://developer.linkedin.com/documents/post-network-updateoperations.
| Anchor | ||||
|---|---|---|---|---|
|
Network updates serve as one of the core experiences on LinkedIn, giving users the ability to share rich content in their professional network. Through the Share API, you can enable users to take full advantage of this functionality within your application. Use the Share API for:
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
<linkedin.shareResources>
<comment>{$ctx:comment}</comment>
<title>{$ctx:title}</title>
<description>{$ctx:description}</description>
<submittedUrl>{$ctx:submittedUrl}</submittedUrl>
<submittedImageUrl>{$ctx:submittedImageUrl}</submittedImageUrl>
<code>{$ctx:code}</code>
</linkedin.shareResources> |
Properties
comment:Text of member's comment. (Similar to deprecated current-status field.)title:Title of shared document.description:Parent node for information on shared document.submittedUrl:URL for shared content.submittedImageUrl:Required - URL for image of shared content.code:Required - One of anyone: all members, or connections-only: connections only.
Sample request
Following is a sample REST request that can be handled by the shareResources operation.
| Code Block | ||||
|---|---|---|---|---|
| ||||
{
"comment":"Check out the LinkedIn Share API!",
"title":"LinkedIn Developers Documentation On Using the Share API",
"description":"Leverage the Share API to maximize engagement on user-generated content on LinkedIn",
"submittedUrl":"https://developer.linkedin.com/documents/share-api",
"submittedImageUrl":"http://m3.licdn.com/media/p/3/000/124/1a6/089a29a.png",
"code":"anyone",
"accessToken":"AQXImsqaARriTxWZgU14P2kCov455xQcL4duyYlgoD4g2mlVdTEiwMLtK1iKYhscwCvzZErt1QbX50-f8iTW02DtSPGPUEPPvhkLsrQP3jDCFzvOHbIU47a-6yeLXBCmAXCS2Q9Etb- R1BaSnbcohgmpMYYISVr_nmamqYlQ-SmvtKHdhs0",
"apiUrl":"https://api.linkedin.com"
} |
Related LinkedIn documentation
...
| Code Block | ||||
|---|---|---|---|---|
| ||||
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
name="linkedin_getnetworkupdates_proxy_NSshareResources"
transports="https,http"
statistics="disable"
trace="disable"
startOnLoad="true">
<target> http"
<inSequence onErrorstartOnLoad="faultHandlerSeqtrue">
<property nametrace="apiUrl" expression="json-eval($.apiUrl)"/disable">
<description/>
<property name="accessToken" expression="json-eval($.accessToken)"/><target>
<inSequence>
<property name="id" expression="json-eval($.id)"/> <property name="scopeaccessToken" expression="json-eval($.scopeaccessToken)"/>
<property name="typecomment" expression="json-eval($.typecomment)"/>
<property name="counttitle" expression="json-eval($.counttitle)"/>
<property name="startdescription" expression="json-eval($.startdescription)"/>
<property name="aftersubmittedUrl" expression="json-eval($.aftersubmittedUrl)"/>
<property name="beforesubmittedImageUrl" expression="json-eval($.beforesubmittedImageUrl)"/>
<property name="showHiddenMemberscode" expression="json-eval($.showHiddenMemberscode)"/>
<property name="fieldSelectorsapiUrl" expression="json-eval($.fieldSelectorsapiUrl)"/>
<linkedin.init>
<apiUrl>{$ctx:apiUrl}</apiUrl>
<accessToken>{$ctx:accessToken}</accessToken>
</linkedin.init>
<linkedin.getNetworkUpdates> </linkedin.init>
<id>{$ctx:id}</id> <linkedin.shareResources>
<type>{$ctx:type}</type> <scope><comment>{$ctx:scopecomment}</scope>comment>
<count><title>{$ctx:counttitle}</count>title>
<start><description>{$ctx:startdescription}</start>/description>
<after><submittedUrl>{$ctx:aftersubmittedUrl}</after>submittedUrl>
<before><submittedImageUrl>{$ctx:beforesubmittedImageUrl}</before>submittedImageUrl>
<showHiddenMembers>{$ctx:showHiddenMembers}</showHiddenMembers>
<fieldSelectors> <code>{$ctx:fieldSelectorscode}</fieldSelectors>code>
</linkedin.getNetworkUpdates> <property name="messageType" value="application/json" scope="axis2"/> </linkedin.shareResources>
<filter source="$axis2:HTTP_SC" regex="^[^2][0-9][0-9]">
<then>
<property name="ERROR_CODE" expression="$axis2:HTTP_SC"/>
<switch source="$axis2:HTTP_SC">
<case regex="401">
<property name="ERROR_MESSAGE" value="Unauthorized"/>
<property name="error_description" expression="json-eval($.message)"/>>
</case>
<case regex="403">
<property name="ERROR_MESSAGE" value="Forbidden"/>
<property name="error_description" expression="json-eval($.message)"/>
</case> </case>
<case regex="404"> <case regex="404">
<property name="ERROR_MESSAGE" value="Not Found"/> <property name="errorERROR_descriptionMESSAGE" expressionvalue="json-eval($.message)Not Found"/>
</case>
<case regex="400">
<property name="ERROR_MESSAGE" value="Bad Request"/>
<property name="error_description" expression="json-eval($.message)"/>
</case> </case>
</switch> </switch>
<sequence key="faultHandlerSeq"/> </then>
</filter>
<respond/>
</inSequence>
<outSequence>
<send <log/>
</outSequence> <<send/target>>
<description/> </proxy> </outSequence>
</target>
</proxy> |