Accept invitation received

Tags: #linkedin #content #operations #snippet #invitation
Author: Florent Ravenel
Last update: 2023-05-29 (Created: 2022-04-05)
Description: This notebook allows you to accept invitations to connect on LinkedIn.
Disclaimer: This code is in no way affiliated with, authorized, maintained, sponsored or endorsed by Linkedin or any of its affiliates or subsidiaries. It uses an independent and unofficial API. Use at your own risk.
This project violates Linkedin's User Agreement Section 8.2, and because of this, Linkedin may (and will) temporarily or permanently ban your account. We are not responsible for your account being banned.


Import libraries

from naas_drivers import linkedin
import pandas as pd

Setup LinkedIn

# Lindekin cookies
LI_AT = "AQEDARCNSioDe6wmAAABfqF-HR4AAAF-xYqhHlYAtSu7EZZEpFer0UZF-GLuz2DNSz4asOOyCRxPGFjenv37irMObYYgxxxxxxx"

Get invitations

df_invitation = linkedin.connect(LI_AT, JSESSIONID).invitation.get_received()

Setup invitation id and shared secret

# Value in column "INVITATION_ID"
invitation_id = "691596420000000000"
# Value in column "SHARED_SECRET"
shared_secret = "6xubdsfs"
# If "INVITATION_TYPE" is "Profile" then False else True
is_generic = False


Accept invitation received

result = linkedin.connect(LI_AT, JSESSIONID).invitation.accept(
invitation_id, shared_secret, is_generic


Display result