nvSendMessage
This method allows you to send a message to a person in Sales Navigator.
try {
const workflowId = await linkedapi.nvSendMessage.execute({
personUrl: "https://www.linkedin.com/in/john-doe",
text: "Hi John! I'd love to connect and discuss some opportunities.",
subject: "Let's Connect!"
});
const { errors } = await linkedapi.nvSendMessage.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('Sales Navigator message 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 message to.text– message text, must be up to 1900 characters.subject– subject line, must be up to 80 characters.
Data
The method doesn't return any data.
Errors
personNotFound– provided URL is not an existing LinkedIn person.noSalesNavigator– your account does not have Sales Navigator subscription.messagingNotAllowed– sending a message to the person is not allowed. This could happen for several reasons:- Your monthly Sales Navigator message limit has been reached.
- LinkedIn has restricted your ability to send messages to the person, for example, due to the person's privacy settings.