Skip to content

calling sendInvitations() always results in a 403 status and a security challenge #378

Description

@pkchv

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();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions