Skip to main content

Standard Interface

reactToPost

This method allows you to react to a post using any available reaction type.


try {
  const workflowId = await linkedapi.reactToPost.execute({
    postUrl: "https://www.linkedin.com/posts/username_activity-id",
    type: "like",
    companyUrl: "https://www.linkedin.com/company/company1"
  });
  
  const { errors } = await linkedapi.reactToPost.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('Workflow completed 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

  • postUrl â€“ LinkedIn URL of the post to react.
  • type â€“ enum describing the reaction type.
    • like â€“ standard "like".
    • celebrate â€“ to celebrate an achievement.
    • support â€“ to show support.
    • love â€“ to express love or admiration.
    • insightful â€“ to appreciate insightful content.
    • funny â€“ to react to something humorous.
  • companyUrl (optional) – LinkedIn company page URL. When provided, the reaction will be posted on behalf of the company. Requires content admin access to the company page.

Data

The method doesn't return any data.

Errors

  • postNotFound – provided URL is not an existing LinkedIn post.
  • noPostingPermission â€“ no permission to react on behalf of this company.