withdrawConnectionRequest
This method allows you to withdraw the connection request sent to a person.
try {
const workflowId = await linkedapi.withdrawConnectionRequest.execute({
personUrl: "https://www.linkedin.com/in/john-doe",
unfollow: true // Optional: whether to unfollow the person (default: true)
});
const { errors } = await linkedapi.withdrawConnectionRequest.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 withdrawn 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 withdraw the connection request from.unfollow– (optional) boolean indicating whether you want to unfollow the person when withdrawing the request. Default value is true.
Data
The method doesn't return any data.
Errors
personNotFound– provided URL is not an existing LinkedIn person.notPending– there is no pending connection request to this person.