endorsePersonSkill
This method allows you to endorse a skill on the profile of a person who is your 1st-degree connection.
LinkedIn lets you endorse skills only of your 1st-degree connections. For anyone else, the method endorses nothing and returns
connectionNotFound.
The method never removes an endorsement. If you have already endorsed the skill, it is left as it is and the method succeeds.
To endorse every skill whose name matches one or more patterns, use
endorsePersonSkills.
typescript
try {
const workflow = await linkedapi.endorsePersonSkill.execute({
personUrl: "https://www.linkedin.com/in/person1",
skillName: "Project Management"
});
const { errors } = await linkedapi.endorsePersonSkill.result(workflow.workflowId);
// The list of possible execution errors is below
if (errors && errors.length > 0) {
console.warn('Workflow completed with execution errors:');
errors.forEach(error => {
console.warn(` - Type: ${error.type}, Message: ${error.message}`);
});
} else {
console.log('Workflow completed successfully.');
}
} catch (e) {
// A list of all critical errors can be found here:
// https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}Params
personUrl– public or hashed LinkedIn URL of the person whose skill you want to endorse.skillName– name of the skill to endorse, up to 200 characters. It must equal the skill's name on the person's profile; letter case and extra spaces are ignored. It is not a pattern. Skill names are shown as the profile owner entered them, in the owner's language, whatever your own LinkedIn language: a German profile listsProjektmanagement, notProject Management.
The method searches the person's full skills list, not only the top skills shown on their profile page.
Data
The method doesn't return any data.
Errors
personNotFound– provided URL is not an existing LinkedIn person.connectionNotFound– person is not your 1st-degree connection, so LinkedIn doesn't let you endorse their skills.skillNotFound– person's profile has no skill with this name.endorsementUnavailable– person has the skill, but LinkedIn offers no way to endorse it, for example because they turned endorsements off.limitExceeded– the account has reached itsstEndorsementslimit, so the skill was not endorsed. Every successful endorsement counts toward this limit, including one where the skill was already endorsed.
See the st.endorsePersonSkill action reference for the complete response contract.