Links

Send message to profile

Tags: #linkedin #message #naas_drivers #content #snippet #text
Author: Florent Ravenel
Last update: 2023-05-29 (Created: 2021-06-17)
Description: This notebook allows you to send a message to a LinkedIn profile.
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.

Input

Import library

from naas_drivers import linkedin

Get your cookies

LI_AT = "YOUR_COOKIE_LI_AT" # EXAMPLE AQFAzQN_PLPR4wAAAXc-FCKmgiMit5FLdY1af3-2
JSESSIONID = "YOUR_COOKIE_JSESSIONID" # EXAMPLE ajax:8379907400220387585

Enter content and recipient URL

CONTENT = "Hello !"
RECIPIENTS_URL = "LINKEDIN_URL"

Model

Connect to linkedin API

result = linkedin.connect(LI_AT, JSESSIONID)

Output

Send the message

result = linkedin.message.send(content=CONTENT, recipients_url=RECIPIENTS_URL)