How do I authenticate AccountAPI using wordnik-python3?

Skip to first unread message

Jodi Schneider

Apr 12, 2019, 11:27:39 AM4/12/19

I can get definitions successfully, but I'm having difficulty authenticating the AccountAPI using wordnik-python3. I can set up AccountApi but when I call the authenticate method I receive a HTTP 403 error. I've checked my login details are correct, on both the website and with the Swagger JSON script. I ran the Wordnik test script and 19 of the 30 tests failed, including authenticate.

My code and error output are below. Does anyone have advice on what I may be doing wrong? 



apiKey = 'anonymizing'
client = swagger.ApiClient(apiKey, apiUrl)
USER = 'anonymizing'
PW =  'anonymizing'

account = AccountApi.AccountApi(client)
response = account.authenticate(USER, PW)


Traceback (most recent call last):

  File "", line 10, in <module>

    response = account.authenticate(USER, PW)

  File "/Users/jodi/projecteuler/wordnik/", line 67, in authenticate

    postData, headerParams)

  File "/Users/jodi/projecteuler/wordnik/", line 73, in callAPI

    request = urllib.request.urlopen(requestParams)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 222, in urlopen

    return, data, timeout)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 531, in open

    response = meth(req, response)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 641, in http_response

    'http', request, response, code, msg, hdrs)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 569, in error

    return self._call_chain(*args)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 503, in _call_chain

    result = func(*args)

  File "/Users/jodi/anaconda3/lib/python3.7/urllib/", line 649, in http_error_default

    raise HTTPError(req.full_url, code, msg, hdrs, fp)

urllib.error.HTTPError: HTTP Error 403: Forbidden


Apr 12, 2019, 12:43:17 PM4/12/19
to Wordnik API

I am not very familiar with python. Quick question; is the 503 error in the Wordnik response?

The “http_error_default” is what is making me ask the question


Reply all
Reply to author
0 new messages