PythonAnywhere Forums

Whitelist Suggestion: LinkedIn

We are working on getting a research study set up. Part of the protocol is asking for permission to access some data using the LinkedIn API. I'm running into the following error:

HTTPSConnectionPool(host='www.linkedin.com', port=443): Max retries exceeded with url: /uas/oauth2/accessToken?grant_type=authorization_code&code=&redirect_uri=http://<user>.pythonanywhere.com/survey/linkedin/token/&client_id=<code>&client_secret=<code> (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

Looking through the forums it looks like this might be a whitelist issue? (https://www.pythonanywhere.com/forums/topic/1860/). If it makes any difference, right now we are on a free account to test things and make sure we can get everything working. If we can get this kink ironed out we plan on moving up to a pay to play account.

Thanks!

Hi cjohns,

I just checked and we already have api.linkedin.com whitelisted (but not the whole linkedin.com). You can see all our whitelisted sites here. Would you be able to modify your linkedin api call so that it accesses the actual api? If parts of the linkedin api does require calls to linkedin.com, point us to a link/reference and we can add that to the whitelist for you.

Alternatively you could try to upgrade your account to a paying account, in which case you would get unrestricted internet access. Unfortunately we are not able to allow unpaid accounts unrestricted access because it has been abused and used for malicious intents in the past.

Conrad

Hi Conrad,

I think that should do the trick but if for some reason it doesn't I'll post back and you can remove it.

Craig

Hi Conrad,

Sorry, had you already whitelisted the .com or is that in the works? I'm still receiving the error and I want to make sure I'm debugging the right thing.

Thanks!

Craig

We already have api.linkedin.com whitelisted because that's where the API for linkedin is. We have no plans to whitelist www.linkedin.com.

Hey guys,

I upgraded my account to see if that made a difference and it's still a no go. If you look at the authentication documentation in order to hook into the linkedin API you must first ask for access which uses linkedin.com.

https://developer.linkedin.com/documents/authentication

Step 3. Get an access token Access token is unique to a user and an API Key. You need access tokens in order to make API calls to LinkedIn on behalf of the user who authorized your application. The first step is asking the user to grant access with the LinkedIn authorization dialog.

a. Generate Authorization Code by redirecting user to LinkedIn's authorization dialog

https://www.linkedin.com/uas/oauth2/authorization?response_type=code &client_id=YOUR_API_KEY &scope=SCOPE &state=STATE &redirect_uri=YOUR_REDIRECT_URI

I'm unable to redirect to the dialog because of the issue above or at least that what I think the issue is. If we can iron out the issue great, if it's not going to be possible do to technical constraints that's fine, I just need to know so I can look for another solution.

Thanks!

After you upgraded, did you start a new console or reload your web app?

Hi Glenn,

I just reloaded the website in on the dashboard and we appear to be good to go. Thanks for the suggestions and the help!

Craig

Guys, I am new on Python, so I am not a great source of information, but I know a particularity about Linkedin's API: you can shot ONLY ONE REQUEST A DAY, for each autorized account. So, after first request, you have to wait 24 hours to request again.

Best regards, Miro.

Hi, I'm having the same issue, where the host in my error is 'api.clarifai.com'. Is it possible to get api.clarifai.com whitelisted?

Thanks in advance!

Cool. I've added that to the whitelist.