# checkConnectionStatus

This method allows you to check the connection status between your account and another person.

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

  const { data, errors } = await linkedapi.checkConnectionStatus.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}`);
    });
  }

  // The structure of the 'data' object is below
  if (data) {
    console.log('Connection status:', data.connectionStatus);
    console.log('Workflow completed successfully. Data:', data);
  }
} 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 CheckConnectionStatusParams, LinkedApiError

try:
    workflow = linkedapi.check_connection_status.execute(
        CheckConnectionStatusParams(person_url="https://www.linkedin.com/in/john-doe")
    )

    result = linkedapi.check_connection_status.result(workflow.workflow_id)
    data = result.data
    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}")

    # The structure of the 'data' object is below
    if data:
        print("Connection status:", data.connection_status)
        print("Workflow completed successfully. Data:", data)
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

- `personUrl`  – [public or hashed](/faq/what-are-hashed-url-and-public-url) LinkedIn URL of the person you want to check a connection status with.

## Data

- `connectionStatus`  – current connection status with the person. Possible values:
  - `connected` – your account is connected with the person.
  - `notConnected` – your account is not connected with the person.
  - `pending` – your account has a pending connection request to the person.
  - `incoming` – the person has sent your account a connection request that is awaiting your response.

## Errors

- `personNotFound` – provided URL is not an existing LinkedIn person.
- `selfProfileNotAllowed` – action cannot be performed on your own profile.
