Platforms
LinkedIn

LinkedIn Integration

The Web Action SDK provides powerful actions to interact with LinkedIn. This guide covers all available LinkedIn actions, their inputs, outputs, and usage examples.

Actions

Check If Connected

Checks if the user is connected to another user on LinkedIn.

Function: sdk.linkedin.checkIfConnected
 
Input:
{
  profileUrl: string,  // optional, enter at least one of profileUrl or name
  name: string  // optional
}
 
Output:
{
  connectionStatus: string // 'connected', 'not connected', 'pending'
}

Example:

const result = await sdk.linkedin.checkIfConnected({
  profileUrl: "https://www.linkedin.com/in/mark-cuban-06a0755b/",
});
 
console.log(result.connectionStatus);

Get Profile Information

Retrieves the profile information for a LinkedIn user.

Function: sdk.linkedin.getProfileInformation
 
Input:
{
  profileUrl: string,  // optional, enter at least one of profileUrl or name
  name: string  // optional
}
 
Output:
{
  name: string,
  profileUrl: string,
  location: string,
  tagline: string,
  about: string,
  education: Array<{
    school: string,
    degree: string,
    description: string,
    dates: string
  }>,
  experience: Array<{
    organization: string,
    title: string,
    description: string,
    dates: string,
  }
}

Example:

const profile = await sdk.linkedin.getProfileInformation({
  name: "Mark Cuban",
});
 
console.log(profile);

Make Post

Creates a post on LinkedIn.

Function: sdk.linkedin.makePost;
 
Input: {
  postContent: string;
}
 
Output: {
  message: string; // notifying the success of the post
}

Example:

const post = await sdk.linkedin.makePost({
  postContent: "Hello, world!",
});
 
console.log(post);

Get Messages From User

Retrieves messages from a specific LinkedIn user.

Function: sdk.linkedin.getMessagesFromUser
 
Input:
{
  from: string,  // optional: enter at least one of from, messageThreadUrl, profileUrl
  messageThreadUrl: string,  // optional
  profileUrl: string,  // optional
  lastN: number  // 1-10, optional, default is 10
}
 
Output:
{
  messages: Array<{
    participantNames: string,
    message: string,
    timestamp: string
  }>
}
 

Example:

const messages = await sdk.linkedin.getMessagesFromUser({
  from: "John Doe",
  lastN: 5,
});
 
console.log(messages);

Get Recent Messages

Retrieves recent messages from the user's LinkedIn inbox.

Function: sdk.linkedin.getRecentMessages;
 
Input: {
  lastN: number; // 1-10, optional, default is 10
}
 
Output: {
  messages: Array<{
    participantNames: string;
    message: string;
    timestamp: string;
  }>;
}

Example:

const recentMessages = await sdk.linkedin.getRecentMessages({
  lastN: 5,
});
 
console.log(recentMessages);

Send Message

Sends a message to a specific LinkedIn user.

Function: sdk.linkedin.sendMessage
 
Input:
{
  to: string, // optional, enter at least one of to, profileUrl, messageThreadUrl
  message: string,
  profileUrl: string,  // optional
  messageThreadUrl: string,  // optional
}
 
Output:
{
  message: string // confirming the success of the message
}

Example:

const message = await sdk.linkedin.sendMessage({
  messageThreadUrl: "https://www.linkedin.com/messaging/thread/loremipsumuid",
  message: "Hey whats up!",
});
 
console.log(message);

Search For Users

Searches for users on LinkedIn.

Function: sdk.linkedin.searchForUsers
 
Input:
{
  searchQuery: string,
  topN: number  // 1-10, optional, default is 10
}
 
Output:
{
  users: Array<{
    name: string,
    profileUrl: string,
    tagline: string,
    connectionDegree: string,
  }>
}

Example:

const users = await sdk.linkedin.searchForUsers({
  searchQuery: "Jane Doe",
  topN: 10,
});
 
console.log(users);

Send Connection Request

Sends a connection request to a specific LinkedIn user.

Function: sdk.linkedin.sendConnectionRequest
 
Input:
{
  to: string,  // optional, enter at least one of to, profileUrl
  profileUrl: string,  // optional
  note: string  // optional
}
 
Output:
{
  message: string // confirming the success of the connection request
}

Example:

const connectionRequest = await sdk.linkedin.sendConnectionRequest({
  profileUrl: "https://www.linkedin.com/in/john-doe-1234567890/",
  note: "Hello, world!",
});
 
console.log(connectionRequest);

Get Invitations

Retrieves invitations from the user's LinkedIn inbox.

Function: sdk.linkedin.getInvitations;
 
Input: {
  topN: number; // 1-10, optional, default is 10
}
 
Output: {
  invitations: Array<{
    name: string;
    profileUrl: string;
    subtitle: string;
    connectionNote: string;
  }>;
}

Example:

const invitations = await sdk.linkedin.getInvitations({
  topN: 10,
});
 
console.log(invitations);

Troubleshooting

If you encounter any issues while using the LinkedIn integration, please refer to our Troubleshooting Guide for common problems and their solutions.