Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LinkedIn API "Empty oauth2 access token" error

Sorry if this is question is not suitable for stackoverflow.

I've got access token from Linkedin API. I am trying to use it however I am not sure how to include my access_token. I cannot find any example on documentation.

base_url = f'https://api.linkedin.com/v2/people?access_token={linkedin_key}&format=json'
requests.get(base_url).json()

This outputs

    {'serviceErrorCode': 65604,
 'message': 'Empty oauth2 access token',
 'status': 401}

does anyone know what's wrong? Thank you.

like image 640
haneulkim Avatar asked Dec 06 '22 10:12

haneulkim


1 Answers

The access token param you need to pass is oauth2_access_token not access_token.

For example:

https://api.linkedin.com/v2/me?oauth2_access_token={linkedin_key}

I can't find it in the docs and it's been a while, but that's how I use it in my app.

like image 165
Ervin Kalemi Avatar answered Dec 26 '22 11:12

Ervin Kalemi