jotform / jotform-api-python Goto Github PK
View Code? Open in Web Editor NEWJotForm API - Python Client
License: GNU General Public License v2.0
JotForm API - Python Client
License: GNU General Public License v2.0
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')
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…
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."
"print message" In line 32 of the jotform.py file
I was getting always Error 403: Forbidden
To fix add 'User-Agent': 'Mozilla/5.0' on the headers.
line 57
headers = { 'apiKey': self.__apiKey, 'User-Agent': 'Mozilla/5.0' }
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.
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?
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/
Please, use six library
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'
The HIPAA servers allow API access. An error is properly raised from the library for it either. It just kicks back saying content invalid.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.