Recommendation API
Note
Usage of this API is restricted to approved partners, subject to limitations via API agreement.
All API requests are represented in protocol 2.0.0. Therefore, all API requests require the header X-Restli-Protocol-Version: 2.0.0
With the Recommendation API, you can replicate the full LinkedIn experience around recommendation of LinkedIn members.
Create Recommendation
Create a recommendation by issuing a POST that specifies the recommendee
, recommendeeEntity
(position), and relationship between the recommender
and the recommendee
. You can only send recommendations on behalf of the authenticated user.
POST https://api.linkedin.com/v2/recommendation
Request Body Fields
Field Name | Format | Description |
---|---|---|
message | String | A message that recommender sends to recommendee. |
recommendationText | String | Content of the recommendation. |
recommendee | Urn | The recommendee represented in personUrn. |
recommendeeEntity | optional Urn | The recommendee's entity. For example: urn:li:position:(urn:li:person:, ) |
recommenderEntity | optional Urn | The recommender's entity. For example: urn:li:position:(urn:li:person:, ) |
relationship | optional String | Relationship between recommender and recommendee. Can be the following enum values:
|
subject | String | Subject of the message that recommender sends to recommendee. |
sample request body
{
"recommendeeEntity": "urn:li:position:(urn:li:person:123ABC,123456)",
"visibilityForRecommender": "EVERYONE",
"relationship": "RECOMMENDEE_SENIOR_THAN_RECOMMENDER",
"recommendee": "urn:li:person:123ABC",
"subject": "Recommendation!"
"recommendationText": "Bob Smith is an amazing leader. He is the best!",
"message": "Giving you a recommendation!"
}
sample response header
X-RestLi-Id: urn:li:recommendation:(urn:li:person:123ABC,123456)
Retrieve Recommendations
Once a recommendation has been created, you can retrieve that recommendation.
GET https://api.linkedin.com/v2/recommendations/urn:li:recommendation:(urn:li:person:123ABC,123456)
Above is the API request represented in pretty print. With X-Restli-Protocol-Version: 2.0.0
, you will need to do the following:
GET https://api.linkedin.com/v2/recommendation/urn%3Ali%3Arecommendation%3A%28urn%3Ali%3Aperson%3A123ABC%2C123456%29
sample request body
{
"created": 1229538193168,
"id": 123456,
"lastModified": 1269858649984,
"recommendationText": "Bob Smith is an amazing leader. He is the best!",
"recommendee": "urn:li:person:123ABC",
"recommendeeEntity": "urn:li:position:(urn:li:person:123ABC,123456)",
"recommender": "urn:li:person:456DEF",
"relationship": "RECOMMENDEE_SENIOR_THAN_RECOMMENDER",
"status": "VISIBLE",
"visibilityForRecommender": "EVERYONE"
}
For more information, refer to the Recommendation schema.
Alternatively, you can lookup multiple recommendations by doing the following:
GET https://api.linkedin.com/v2/recommendation?ids=List(urn:li:recommendation:(urn:li:person:123ABC,123456),urn:li:recommendation:(urn:li:person:123ABC,456789))
Above is the API request represented in pretty print. With X-Restli-Protocol-Version: 2.0.0
, you will need to do the following:
GET https://api.linkedin.com/v2/recommendation?ids=List(urn%3Ali%3Arecommendation%3A%28urn%3Ali%3Aperson%3A123ABC%2C123456%29,urn%3Ali%3Arecommendation%3A%28urn%3Ali%3Aperson%3A123ABC%2C456789%29)
Retrieve Recommendations by Recipient
You can look up the recommendations the authenticated member has received by requesting the following API:
GET https://api.linkedin.com/v2/recommendation?q=recipient&statusFilters=List(VISIBLE)
Query Parameters
Field | Description | Required | Format |
---|---|---|---|
statusFilters | Status of the recommendation. Can be the following enum values:
|
Yes | List of string |
sample response
{
"elements": [
{
"recommendeeEntity": "urn:li:position:(urn:li:person:123ABC,123456)",
"status": "VISIBLE",
"visibilityForRecommender": "EVERYONE",
"relationship": "RECOMMENDEE_SENIOR_THAN_RECOMMENDER",
"created": 1229538193168,
"lastModified": 1269858649984,
"recommendee": "urn:li:person:123ABC",
"recommendationText": "Bob Smith is an amazing leader. He is the best!",
"recommender": "urn:li:person:456DEF",
"id": 123456
},
{
"recommendeeEntity": "urn:li:position:(urn:li:person:123ABC,234567)",
"status": "VISIBLE",
"visibilityForRecommender": "EVERYONE",
"relationship": "WORKED_IN_SAME_GROUP",
"created": 1229538193168,
"lastModified": 1269858649984,
"recommendee": "urn:li:person:123ABC",
"recommendationText": "Bob Smith is an amazing colleague!",
"recommender": "urn:li:person:999GGG",
"id": 234567
},
...
],
"paging": {
"count": 10,
"links": [
],
"start": 0
}
}
Retrieve Recommendations by Recommender
You can look up the recommendations the authenticated member has given by requesting the following API:
GET https://api.linkedin.com/v2/recommendation?q=recommender&statusFilters=List(VISIBLE)
Query Parameters
Field | Description | Required | Format |
---|---|---|---|
statusFilters | Status of the recommendation. Can be the following enum values:
|
Yes | List of string |
sample response
{
"elements": [
{
"recommendeeEntity": "urn:li:position:(urn:li:person:456DEF,123456)",
"status": "VISIBLE",
"visibilityForRecommender": "EVERYONE",
"relationship": "RECOMMENDEE_SENIOR_THAN_RECOMMENDER",
"created": 1229538193168,
"lastModified": 1269858649984,
"recommendee": "urn:li:person:456DEF",
"recommendationText": "John is great to work with!",
"recommender": "urn:li:person:123ABC",
"id": 123456
},
{
"recommendeeEntity": "urn:li:position:(urn:li:person:999GGG,234567)",
"status": "VISIBLE",
"visibilityForRecommender": "EVERYONE",
"relationship": "WORKED_IN_SAME_GROUP",
"created": 1229538193168,
"lastModified": 1269858649984,
"recommendee": "urn:li:person:999GGG",
"recommendationText": "Alicia is awesome!",
"recommender": "urn:li:person:123ABC",
"id": 234567
},
...
],
"paging": {
"count": 10,
"links": [
],
"start": 0
}
}
Retrieve Recommendations by Descendant
You can find a recommendation and the previous recommendations it replaced with the following API:
GET https://api.linkedin.com/v2/recommendation?q=descendant&recUrn=urn:li:recommendation:(urn:li:person:123ABC,123456)
Above is the API request represented in pretty print. With X-Restli-Protocol-Version: 2.0.0
, you will need to do the following:
GET https://api.linkedin.com/v2/recommendation?q=descendant&recUrn=urn%3Ali%3Arecommendation%3A%28urn%3Ali%3Aperson%3A123ABC%2C123456%29
Query Parameters
Field | Description | Required | Format |
---|---|---|---|
recUrn | The current recommendationUrn input to find the previous recommendations it replaced. | Yes | Urn |
Update Recommendations
You can update an recommendation status
, visibilityForRecommender
and recommendeeEntity
. Only recommendee
can change status
or recommendeeEntity
, and only recommender
can change visibilityForRecommender
.
The only exception is when recommender
withdraws the recommendation
, which will change the status to WITHDRAWN
.
Only one of status
and visibilityForRecommender
may be updated in one request. State machine of status:
- PENDING -> VISIBLE
- PENDING -> HIDDEN
- PENDING -> WITHDRAWN
- PENDING -> REPLACED
- PENDING -> CLOSED
- VISIBLE -> HIDDEN
- VISIBLE -> WITHDRAWN
- VISIBLE -> REPLACED
- VISIBLE -> CLOSED
- HIDDEN -> VISIBLE
- HIDDEN -> WITHDRAWN
- HIDDEN -> REPLACED
- CLOSED -> PENDING
See below for an example:
POST https://api.linkedin.com/v2/recommendation/urn:li:recommendation:(urn:li:person:123ABC,123456)
You can construct the recommendationUrn by taking the recommender personUrn
and the recommendationID
.
Example: urn:li:recommendation:({**recommender personUrn**},{**recommendationID**})
Above is the API request represented in pretty print. With X-Restli-Protocol-Version: 2.0.0
, you will need to do the following:
POST https://api.linkedin.com/v2/recommendation/urn%3Ali%3Arecommendation%3A%28urn%3Ali%3Aperson%3A123ABC%2C123456%29
sample response
{
"patch": {
"$set": {
"status": "VISIBLE"
}
}
}
Feedback
Submit and view feedback for