linkedin-private-api
linkedin-private-api copied to clipboard
calling `sendInvitations()` always results in a `403` status and a security challenge
I'm trying to send an automated invite via sendInvitation()
method, but this always results in a 403
response from LinkedIn API with a security challenge link.
I'll add that the login method works fine, also I can call Search People API, which works, but data is partly anonymized (user public identifier and profile link are set to UNKNOWN
values, profile.fistName
and profile.lastName
are set to empty strings).
I'm wondering if anyone encountered similar issues?
Library version: v1.1.1 Node version: v14.17.6
Steps to reproduce:
import { Client } from "linkedin-private-api";
const username = process.env.USERNAME as string;
const password = process.env.PASSWORD as string;
const profileId = process.env.PROFILE_ID as string;
const trackingId = process.env.TRACKING_ID as string;
async function main() {
try {
const client = new Client();
await client.login.userPass({
username,
password,
});
await client.invitation.sendInvitation({
profileId,
trackingId,
});
} catch (err) {
console.log(err.response.data);
}
}
main();
Does this still happen if you try to send those invites from another LinkedIn account?