Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What function to get own connections #442

Open
Nijneleven opened this issue Oct 8, 2024 · 1 comment
Open

What function to get own connections #442

Nijneleven opened this issue Oct 8, 2024 · 1 comment

Comments

@Nijneleven
Copy link

Is there a function to get your own connections? Im trying via get_profile_connections but it returns an empty list when using my own public id.

@Nijneleven
Copy link
Author

Couldnt find the function so i just made this one:

def get_own_connections(self, count: str) -> Dict:
    """Fetch skills associated with a given job.
    :param job_id: LinkedIn job ID
    :type job_id: str

    :return: Job skills
    :rtype: dict
    """
    params = {
        "decorationId": "com.linkedin.voyager.dash.deco.web.mynetwork.ConnectionListWithProfile-16",
        "count": count,
        "q": "search",
        "sortType": "RECENTLY_ADDED"
    }
    res = self._fetch(
        f"/relationships/dash/connections",
        params=params,
    )
    data = res.json()

    if data and "status" in data and data["status"] != 200:
        self.logger.info("request failed: {}".format(data.get("message")))
        return {}

    return data

It uses the api endpoint thats being used when you visit "https://www.linkedin.com/mynetwork/invite-connect/connections/"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant