sendConnectionRequest
This method allows you to send a connection request to a person.
try {
const workflowId = await linkedapi.sendConnectionRequest.execute({
personUrl: "https://www.linkedin.com/in/john-doe",
note: "Hello! I'd love to connect and discuss opportunities.",
email: "john.doe@example.com" // Optional: required by some people
});
const { errors } = await linkedapi.sendConnectionRequest.result(workflowId);
// The list of possible execution errors is below
if (errors && errors.length > 0) {
console.warn('Workflow completed with execution errors:');
errors.forEach(error => {
console.warn(` - Type: ${error.type}, Message: ${error.message}`);
});
} else {
console.log('Connection request sent successfully.');
}
} catch (e) {
// A list of all critical errors can be found here:
// https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
if (e instanceof LinkedApiError) {
console.error(`Critical Error - Type: ${e.type}, Message: ${e.message}`);
} else {
console.error('An unexpected, non-API error occurred:', e);
}
}
# Python SDK is coming soon!
#
# You can always use Linked API through HTTP
# https://linkedapi.io/docs/
// Go SDK is coming soon!
//
// You can always use Linked API through HTTP
// https://linkedapi.io/docs/
Params
personUrl
– public or hashed LinkedIn URL of the person you want to send a connection request to.note
(optional) – note to include with the connection request.email
(optional) – email address required by some people for sending connection requests to them. If it is required and not provided, the connection request will fail.
Data
The method doesn't return any data.
Errors
personNotFound
– provided URL is not an existing LinkedIn person.alreadyPending
– connection request to this person has already been sent and is still pending.alreadyConnected
– your LinkedIn account is already connected with this person.emailRequired
– person requires an email address to send a connection request.requestNotAllowed
– LinkedIn has restricted sending a connection request to this person. This can happen for the following reasons:- The person has disabled connection requests in their privacy settings.
- You recently sent and withdrew a connection request to this person.
- You have reached LinkedIn's daily, weekly, or monthly limits for sending connection requests.