Остальная часть API работает с полным доступом к профилю.Но есть ли способ получить доступ к полю индекса социальных продаж?
Код до сих пор прилагается ниже.Просто нужно имя поля для SSI для последнего оператора session.get.
from requests_oauthlib import OAuth2Session
from requests_oauthlib.compliance_fixes import linkedin_compliance_fix
# In case the `redirect_url` does not implement https
import os
# Credentials you get from registering a new application
client_id = ''
client_secret = ''
redirect_url = ''
# OAuth endpoints given in the LinkedIn API documentation (check for updates)
authorize_url = 'https://www.linkedin.com/oauth/v2/authorization'
token_url = 'https://www.linkedin.com/oauth/v2/accessToken'
session = OAuth2Session(client_id, redirect_uri=redirect_url)
session = linkedin_compliance_fix(session)
# Authorized Redirect URL (from LinkedIn config)
uri, state = session.authorization_url(authorize_url)
print('Please go here and authorize,', uri)
# Get the authorization verifier code from the callback url
redirect_response = input('Paste the full redirect URL here:')
# Fetch the access token
token = session.fetch_token(token_url,authorization_response=redirect_response,client_secret=client_secret)
print(token)
# Fetch a protected resource, i.e. user profile
r = session.get('https://api.linkedin.com/v1/people/~:(<what do i put here>)?format=json')
print(r.content)