retrievePendingRequests
This method allows you to retrieve pending connection requests sent from your account.
try {
const workflowId = await linkedapi.retrievePendingRequests.execute();
const { data, errors } = await linkedapi.retrievePendingRequests.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}`);
});
}
// The structure of the 'data' object is below
if (data) {
console.log('Pending requests count:', data.requests.length);
data.forEach(request => {
console.log(`Request to: ${request.name} (${request.personUrl})`);
console.log(`Sent: ${request.sentTime}`);
});
}
} 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
The method doesn't require any parameters.
Data
Array of pending requests. Each pending request contains:
name– full name of the person.publicUrl– public LinkedIn URL of the person.headline– headline of the person.sentTime– time since the connection request was sent (e.g., "1 month ago").
Errors
The method has no execution errors (errors is always []).