Forums

Whitelist Suggestion:

Please white list https://api.bitext.com/ - currently trying to access this gives me:

raise ProxyError(e, request=request)
requests.exceptions.ProxyError: HTTPSConnectionPool(host='svc02.api.bitext.com', port=443): Max retries exceeded with url: /concepts/ (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

Ok. I've added that to the whitelist.

Still getting this error:

requests.exceptions.ProxyError: HTTPSConnectionPool(host='svc02.api.bitext.com', port=443): Max retries exceeded with url: /concepts/ (Caused by ProxyError('Cannot connect to proxy.', error('Tunnel connection failed: 403 Forbidden',)))

Code used was:

import requests, json

oauth_token = 'MY TOKEN HERE' endpoint = "https://svc02.api.bitext.com/sentiment/" headers = { "Authorization" : "bearer " + oauth_token, "Content-Type" : "application/json" } params = {"language" : "eng","text" : "I have a beautiful house in Madrid"}

res = requests.post(endpoint, headers=headers, data=json.dumps(params)) resultid = json.loads(res.text).get('resultid')

analysis = None

while analysis == None:

res = requests.get(endpoint + resultid + '/', headers=headers)
if res.status_code == 200 :
    analysis = res.text

print(analysis)

Ok. I've fixed that. You should have better luck now.