Как делать запросы GET к API поиска работы Linkedin с помощью Python - PullRequest
0 голосов
/ 07 ноября 2019

Я смог пройти процедуру аутентификации в соответствии с документацией Microsoft. Я получил токен доступа, но у меня возникают проблемы с поиском документации о том, как сделать запрос GET к API поиска работы Linkedin, используя токен доступа. Я хочу получить список заданий с указанием названия задания и состояния задания.

На данный момент это мой код

from linkedin_v2 import linkedin
import requests
from requests_oauthlib import OAuth1

API_KEY = 'your own'
API_SECRET = 'your own'
return_url = 'http://localhost:8889/'
state='your own'
scope=['r_basicprofile', 'r_emailaddress','w_member_social']

authentication = linkedin.LinkedInAuthentication(API_KEY,API_SECRET,return_url,scope)

**Click on the url and logged in to my account and got the code
print(authentication.authorization_url)**

authentication.authorization_code = 'code you get after log in'
result = authentication.get_access_token()

**Prints the token I need**
print(result.access_token)
print(result.expires_in)

application = linkedin.LinkedInApplication(token='your own token')

**I tried this, but not sure if this is the correct way. Again cannot find documentation to     make get requests in Python.** 

r = requests.get('https://api.linkedin.com/v1/job-search?job-title=Software+Engineer')
print(r) ##Response 401
...