Skip to content

Instantly share code, notes, and snippets.

@aveek22
Created March 12, 2022 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aveek22/253b85ff96e450d7171833e4dade52ad to your computer and use it in GitHub Desktop.
Save aveek22/253b85ff96e450d7171833e4dade52ad to your computer and use it in GitHub Desktop.
url_access_token = "https://www.linkedin.com/oauth/v2/accessToken"
auth_code = "YOUR_AUTH_CODE_FROM_PREVIOUS_VERIFICATION"
payload = {
'grant_type' : 'authorization_code',
'code' : auth_code,
'redirect_uri' : redirect_uri,
'client_id' : client_id,
'client_secret' : client_secret
}
response = requests.post(url=url_access_token, params=payload)
response_json = response.json()
# Extract the access_token from the response_json
access_token = response_json['access_token']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment