Python API issue.

  • beyondbouldering
    Asked on June 6, 2020 at 6:22 AM

    Hi - the libraries at https://github.com/jotform/jotform-api-python no longer work (they give the following error:

    Traceback (most recent call last):
      File "./check_sessionpasses.py", line 38, in <module>
        forms = jotformAPIClient.get_forms()
      File "/home/beyond/.local/lib/python2.7/site-packages/jotform.py", line 142, in get_forms
        return self.fetch_url('/user/forms', params, 'GET')
      File "/home/beyond/.local/lib/python2.7/site-packages/jotform.py", line 76, in fetch_url
        response = urllib2.urlopen(req)
      File "/usr/lib/python2.7/urllib2.py", line 154, in urlopen
        return opener.open(url, data, timeout)
      File "/usr/lib/python2.7/urllib2.py", line 435, in open
        response = meth(req, response)
      File "/usr/lib/python2.7/urllib2.py", line 548, in http_response
        'http', request, response, code, msg, hdrs)
      File "/usr/lib/python2.7/urllib2.py", line 473, in error
        return self._call_chain(*args)
      File "/usr/lib/python2.7/urllib2.py", line 407, in _call_chain
        result = func(*args)
      File "/usr/lib/python2.7/urllib2.py", line 556, in http_error_default
        raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
    urllib2.HTTPError: HTTP Error 403: Forbidden


    I tried running the library in python3 (with some modifications to the jotform.py file) and got the same error.

    What is the issue please?  And it would be great if there was a python3 library as python2 is going to be deprecated shortly.

    Thanks

    Paul

  • Amin JotForm Support
    Replied on June 6, 2020 at 10:30 AM

    Hi there, Paul!

    Thanks for reaching out to us!

    We sincerely apologize for any inconvenience you may have encountered.

    May I ask you what version of Python exactly you are using?

    Also, you can reach out to the API team via email api@jotform.com, or via this form.

    I hope I have been of any help.