Giter Site home page Giter Site logo

jotform-api-python's People

Contributors

appaky avatar aslan-jotform avatar atleta avatar aytekintank avatar cbalci avatar eeertekin avatar ehawman-rosenberg avatar elifceren avatar erikvisser22 avatar jhillacre avatar kennethpdev avatar ozanaksoyy avatar sevastos avatar uelmalioglu avatar umutbugrahan avatar utkubekci avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jotform-api-python's Issues

get_form_submissions bug

Single, double double quote issue in get_form_submissions.

  •    return self.fetch_url('/form/" + formID + "/submissions', params, 'GET')
    
  •    return self.fetch_url('/form/' + formID + "/submissions", params, 'GET')
    

multiple file upload using jotform API

How can I do this using the API(python)
https://www.jotform.com/answers/2212470-how-can-i-upload-multiple-files-with-file-upload-field
https://www.jotform.com/answers/1091707-create-submission-via-api-with-multiple-choice

jotformAPI = JotformAPIClient("YOUR API KEY") 
result = jotformAPI.edit_submission("SUBMISSION ID", {"1_first": "FIRST NAME", "new": "0", "flag": "0"})

# I tried the below post request:

https://api.jotform.com/submission/5070434458147565993?apikey=__APIKEY__
&submission['40']['0']=https://www.jotform.com/uploads/peteliappis/212477037660052/5069611556815543445/careless_azer.PNG
&submission['40']['1']=https://www.jotform.com/uploads/peteliappis/212477037660052/5069611556815543445/careless_azer.PNG
# but created an abomination instead :
            "40": {
                "name": "photos",
                "order": "21",
                "text": "PHOTOS",
                "type": "control_fileupload",
                "answer": [
                    "https://www.jotform.com/uploads/peteliappis/212477037660052/5070434458147565993/_a href=_https_www.jotform.com_uploads_peteliappis_212477037660052_5070434458147565993_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_ target=_blank_ title=_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_a_br_a href=_https_www.jotform.com_uploads_peteliappis_212477037660052_5070434458147565993_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_ target=_blank_ title=_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_https_www.jotform.com_uploads_peteliappis_212477037660052_5069611556815543445_careless_azer.PNG_a_"
                ]
            },
result = jotformAPI.edit_submission("5070434458147565993", {"40_0": "FIRST NAME", "40_1": "https://www.jotform.com/uploads/peteliappis/212477037660052/5069611556815543445/careless_azer.PNG", "40_2": "https://www.jotform.com/uploads/peteliappis/212477037660052/5069611556815543445/careless_azer.PNG"})

I can upload a single photo, but I need to upload multiple photos…

git:// is depreciated

The current installation methods cite URLs with git://. This is no longer supported.

Attempting to install this way will result in a failure with "The unauthenticated git protocol on port 9418 is no longer supported."

Update package published in pypi or update the README

The package published is obsolete and it supports only python2, it should be updated with the latest commits from this repository.

If you don't intend to update the package, the README should be updated to remove the pip install jotform commandline, since you won't be able to use it with python3.

HIPAA accounts not supported?

While attempting to return a list of submissions get_form_submissions(formID=xxxxx) from a form with no HIPAA fields, the entirety of the response I receive is:
{'isHIPAA': 1}

At this point I attempted to simply get_forms() - same response:
{'isHIPAA': 1}

Can I assume that HIPAA-enabled accounts cannot use the API?

filterArray not working as expected in jotformAPIClient.get_form_submissions()

jotformAPIClient.get_form_submissions() isn't using filterArray in a way in keeping with the docs. (also said docs incorrectly reference filter and orderby, instead of filterArray and order_by)


def get_submissions(api_key, set_form_ID, set_limit=100, set_debug=False):
    jotformAPIClient = jf.JotformAPIClient(api_key, debug=set_debug)
    return jotformAPIClient.get_form_submissions(
        formID=set_form_ID,
        limit=set_limit,
        # filterArray={
        #     "workflowStatus:eq":"In Progress",
        # },
        # order_by="created_at"
    )

Result: The 100 most recent submissions.


def get_submissions(api_key, set_form_ID, set_limit=100, set_debug=False):
    jotformAPIClient = jf.JotformAPIClient(api_key, debug=set_debug)
    return jotformAPIClient.get_form_submissions(
        formID=set_form_ID,
        limit=set_limit,
        filterArray={
            "workflowStatus:eq":"In Progress",
        },
        order_by="created_at"
    )

Result: None.


def get_submissions(api_key, set_form_ID, set_limit=100, set_debug=False):
    jotformAPIClient = jf.JotformAPIClient(api_key, debug=set_debug)
    return jotformAPIClient.get_form_submissions(
        formID=set_form_ID,
        limit=set_limit,
        filterArray={
            "workflowStatus:eq":"Approve",
        },
        order_by="created_at"
    )

Result: The oldest 25 results in the "Approved" workflowStatus. (Note the difference in workflowStatus name. Is there some hidden naming going on behind the scenes?)


def get_submissions(api_key, set_form_ID, set_limit=100, set_debug=False):
    # jotformAPIClient = jf.JotformAPIClient(api_key, debug=set_debug)
    # return jotformAPIClient.get_form_submissions(
    #     formID=set_form_ID,
    #     limit=set_limit,
    #     filterArray={
    #         "workflowStatus:eq":"In Progress",
    #     },
    #     order_by="created_at"
    # )
    url = f"https://api.jotform.com/form/{set_form_ID}/submissions?apiKey={api_key}&orderby[created_at]=desc&filter=\u007b%27workflowStatus:eq%27:%27In%20Progress%27\u007d&limit={set_limit}"
    req = urllib.request.Request(
        url,
        data=None,
        # headers are required to avoid a 403
        headers={
            "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36"
        },
    )
    data_json = json.loads(urllib.request.urlopen(req).read())
    return data_json["content"]

Result: The 100 most recent submissions in the "In Progress" workflowStatus. (The desired outcome)
EDIT: jokes, I just realized it's just the most recent submissions. sigh


Please reference this support ticket. The form I am working with is 220114796842154. https://www.jotform.com/answers/4751245-jotform-api-applying-filter-does-not-return-all-submissions/

Client doesn't work in Europe

Hi, thanks for building this python client! Unfortunately it doesn't work in Europe because the __baseUrl is hardcoded to use the non-EU version of the API. I'll be submitting a pull request to fix the problem but I wanted to raise an issue here too for better traceability.

In case you're wondering, this is the output when executing get_forms() from a computer located in Europe:

$ python test.py
Traceback (most recent call last):
  File "test.py", line 22, in <module>
    main()
  File "test.py", line 16, in main
    forms = jotformAPIClient.get_forms()
  File "/Users/dafydd/dev/personal/github/duffj/jotform-downloader/jotform-api-python/jotform.py", line 143, in get_forms
    return self.fetch_url('/user/forms', params, 'GET')
  File "/Users/dafydd/dev/personal/github/duffj/jotform-downloader/jotform-api-python/jotform.py", line 81, in fetch_url
    return responseObject['content']
KeyError: 'content'

Missing HIPAA endpoint support.

The HIPAA servers allow API access. An error is properly raised from the library for it either. It just kicks back saying content invalid.

How to download files

The documentation doesn't mention it, but the files can't be downloaded without authentication. Providing the API key doesn't seem to be enough (at least the fetch_url returns a 404, just as an unauthenticated session in the browser). I hope we don't have to resort to password authentication (or worse, having to simulate a log in). What's the solution here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.