nvSyncConversation

This method allows you to sync a conversation in Sales Navigator so you can start polling it.

typescript
try {
  const workflow = await linkedapi.nvSyncConversation.execute({
    personUrl: "https://www.linkedin.com/in/john-doe",
    days: 14
  });

  const { data, errors } = await linkedapi.nvSyncConversation.result(workflow.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 conversation synced. Syncing until ${data.syncUntil}`);
  }
} 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);
  }
}

Params

  • personUrlpublic or hashed LinkedIn URL of the person whose conversation you want to sync.
  • days (optional) – how many days the conversation stays synchronized, from 1 to 90. Defaults to 30.

Data

  • syncUntil – moment when synchronization of this conversation stops. Once it passes, polling keeps returning the messages collected so far, but they are no longer updated. Call this method again for the same person to start a new period; the accumulated history is preserved.

Errors

  • noSalesNavigator – your account does not have Sales Navigator subscription.
  • personNotFound – provided URL is not an existing LinkedIn person.