-
Notifications
You must be signed in to change notification settings - Fork 4
5. Connection requests
Emir OĞUZ edited this page Jul 12, 2024
·
2 revisions
After a successful search we will have some of linkedin profiles in an array. We can send connection requests.
const client = new LinkedIn()
await client.login('[email protected]', 'your password')
let people = await client.searchPeople({
keywords: 'Javscript Developer',
network: ['S']
}, 250)
for (let person of people) {
try {
await person.connectionRequest(client, 'Hi ' + person.details.name + '! Please accept me invitation.')
}
catch (e) { console.log(e.message); }
}
let browser = await client.getBrowser()
browser.close()
In this method we have 3 parameters.
/** Send connection request to user
* @param {LinkedIn} linkedinClient - Client that will used in request
* @param {string} connectionMessage - Message that will send with connection request
* @param {number} waitMs - Wait milliseconds (default is coming from linkedin client)
*/
async connectionRequest(linkedinClient, connectionMessage, waitMs)
- linkedinClient: the client that we created first.
- connectionMessage: the message to send in request. (not required)
- waitMs: wait milliseconds after request. (not required)
It will throw error if already connected of cannot be connectable.