Open deividcingolani opened 2 years ago
I've also checked the code but couldn't figure out how to fetch the previous work experience from a profile. Is it possible?
any update?
const client = new Client();
await client.login.userPass({ username, password });
const profile = await client.profile.getOwnProfile();
const result: any = await client.request.get(
`https://www.linkedin.com/voyager/api/identity/profiles/${profile?.entityUrn.split(':')[3]}/profileView`
);
const aggregateResults = result?.included?.reduce(
(acc: Record<string, any[]>, item: any) => {
if (item.$type == 'com.linkedin.voyager.identity.profile.Position') {
acc.positions.push(item);
} else if (item.$type == 'com.linkedin.voyager.identity.profile.Certification') {
acc.certifications.push(item);
} else if (item.$type == 'com.linkedin.voyager.entities.shared.MiniSchool') {
acc.education.push(item);
}
return acc;
},
{ certifications: [], positions: [], education: [] }
);
Not perfect but could give that a go
Hi!