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

Updated examples get_profile and create_posts in line with new API #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

clockworkpc
Copy link

The current examples use the /me endpoint and try to identify the profile by the following URN string:
f"urn:li:person:{me_response.entity['id']}.

However, I found that even though I have a valid 3-legged-token with the necessary scopes enabled, I was getting an error.

I believe that the most recent changes to the LinkedIn API require the following changes:

  1. /userinfo GET endpoint instead of /me
  2. me_response.entity['sub'] instead of me_response.entity['id']

There are some further differences in the names of the fields returned by the userinfo and me endpoints, which are reflected in the proposed changes in the example get_profile.py.

@clockworkpc
Copy link
Author

I also wrote a tidier script that focuses on the new API:
https://gist.github.com/clockworkpc/c311d4aea82d8b5adc27bbb6382455ee

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

Successfully merging this pull request may close these issues.

1 participant