syncInbox
This method enables whole-inbox monitoring for your account so you can poll the inbox for messages across every conversation. Run it once per account.
Unlike
syncConversation, which watches a single person,syncInboxtracks your entire inbox but only captures messages that arrive after it is enabled.
typescript
try {
const workflow = await linkedapi.syncInbox.execute();
const { errors } = await linkedapi.syncInbox.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('Inbox monitoring enabled.');
}
} 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
This method takes no parameters.
Data
The method doesn't return any data.