# reactToPost

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

```typescript
try {
  const workflow = 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(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('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
from linkedapi import ReactToPostParams, LinkedApiError

try:
    workflow = linkedapi.react_to_post.execute(
        ReactToPostParams(
            post_url="https://www.linkedin.com/posts/username_activity-id",
            type="like",
            company_url="https://www.linkedin.com/company/company1",
        )
    )

    result = linkedapi.react_to_post.result(workflow.workflow_id)
    errors = result.errors

    # The list of possible execution errors is below
    if errors:
        print("Workflow completed with execution errors:")
        for error in errors:
            print(f" - Type: {error.type}, Message: {error.message}")
    else:
        print("Workflow completed successfully.")
except LinkedApiError as e:
    # A list of all critical errors can be found here:
    # https://linkedapi.io/sdks/handling-results-and-errors/#handling-critical-errors
    print(f"Critical Error - Type: {e.type}, Message: {e.message}")
except Exception as error:
    print("An unexpected, non-API error occurred:", error)
```

## 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.
