Endorsing skills
This page describes how to create workflows for endorsing skills on the profiles of your 1st-degree connections.
Each example below has its Node SDK call in the Node tab, and the label over each completion says what that call returns.
Each example below has its Python SDK call in the Python tab, and the label over each completion says what that call returns.
Each example below has its CLI command in the CLI tab, and the label over each completion says what the command prints.
LinkedIn lets you endorse skills only of your 1st-degree connections. Endorsing never removes an endorsement: a skill you have already endorsed is left as it is and reported as a success.
Endorsing a skill
To endorse one skill by its name, you need to include st.endorsePersonSkill action in your workflow. It can also start the workflow on its own, with personUrl and skillName. Here's an example:
Workflow:
{
"actionType": "st.openPersonPage",
"personUrl": "https://www.linkedin.com/in/person1",
"basicInfo": false,
"then": {
"actionType": "st.endorsePersonSkill",
"skillName": "Project Management"
}
}Completion:
Completion – the method returns no data; a failed action comes back in errors:
Completion – with --json the CLI prints {"success": true, "data": null}, or the action's error:
{
"actionType": "st.openPersonPage",
"success": true,
"data": {
"then": {
"actionType": "st.endorsePersonSkill",
"success": true
}
}
}Endorsing skills that match patterns
To endorse every skill whose name matches one or more patterns, you need to include st.doForSkills with st.endorsePersonSkill as a child of st.retrievePersonSkills. Omit skillNamePatterns to endorse every skill. Skill names are in the profile owner's language, so write patterns in that language.
Patterns use RE2 syntax, the dialect of Go
regexpand Google SheetsREGEXMATCH. Ordinary patterns read like JavaScript regular expressions, but lookaround ((?=…),(?!…)) and backreferences (\1) are not supported. Matching is case-insensitive and searches anywhere in the name; anchor a pattern with^…$to match the whole name. Seest.doForSkillsfor the full rules.
Patterns are JSON strings – in the SDKs, ordinary string literals – so each backslash is written twice: "project\\s*manage" is the regular expression project\s*manage.
In the CLI, put each --pattern in single quotes so the shell passes \, *, |, $ and parentheses through unchanged, and write a backslash once: --pattern 'project\s*manage'. Give exactly one of --skill, --pattern (repeatable, up to 20) and --all – --all endorses every skill. None, or more than one, is rejected with exit code 5 and nothing is endorsed, so the command never endorses every skill by accident. In a terminal, --pattern and --all print one line per selected skill: Endorsed: <skill> or Not endorsed: <skill> - <errorType>. With --json, or into a pipe, they print the selected skills as data, each with skillName, success and error.
Here's an example that endorses only skills related to business and project management:
Workflow:
{
"actionType": "st.openPersonPage",
"personUrl": "https://www.linkedin.com/in/person1",
"basicInfo": false,
"then": {
"actionType": "st.retrievePersonSkills",
"then": {
"actionType": "st.doForSkills",
"skillNamePatterns": ["business", "project\\s*manage", "^(agile|scrum)$"],
"then": {
"actionType": "st.endorsePersonSkill"
}
}
}
}Completion:
Completion – result() returns in data one item per selected skill, with skillName, success and error. Check every item: errors only covers failures to open the profile or read its skills. The workflow behind it completes like this:
Completion – the CLI prints one item per selected skill, with skillName, success and error, as data. Check every item. The workflow behind it completes like this:
{
"actionType": "st.openPersonPage",
"success": true,
"data": {
"then": {
"actionType": "st.retrievePersonSkills",
"success": true,
"data": [
{
"name": "Business Strategy",
"then": [
{
"actionType": "st.endorsePersonSkill",
"success": true
}
]
},
{
"name": "Python"
},
{
"name": "Project Management",
"then": [
{
"actionType": "st.endorsePersonSkill",
"success": true
}
]
}
]
}
}
}Every skill of the person is listed; only the selected ones carry a then array with the endorsement result.
This page provides examples of workflows and their completions. For detailed documentation on constraints, parameters, and possible results of specific actions, always refer to the corresponding action documentation pages.