jotform / jotform-api-python

JotForm API - Python Client
GNU General Public License v2.0
39 stars 48 forks source link

How to download files #7

Open atleta opened 7 years ago

atleta commented 7 years ago

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?

amcsparron2793 commented 3 years ago

any progress on this?

amcsparron2793 commented 3 years ago

this is obviously a super old issue, but i've found that this, seems to work,

` r = requests.get(x, allow_redirects=True, params={'apiKey': 'xxxxxxxxxxxxxx12345678987654321})

open the binary that is downloaded and stored as r, as the last chunk of y

                # (each chunk is defined by a slash in the url)
                # and write it to file
                open('./output/Missed_Files/' + (str(y.rsplit('/', 1)[1])), 'wb').write(r.content)`

i find it super odd that the jotform API doesn't work though...

GrantNagel commented 12 months ago

@amcsparron2793 Hi there, I have been trying to get this to work as our data cannot be publicly accessible. I'm having to simulate a log in through requests via python but am having a lot of issues.

Is there any chance you could share your full obfuscated code so I can replicate in our python environment?

Thanks

amcsparron2793 commented 11 months ago

@amcsparron2793 Hi there, I have been trying to get this to work as our data cannot be publicly accessible. I'm having to simulate a log in through requests via python but am having a lot of issues.

Is there any chance you could share your full obfuscated code so I can replicate in our python environment?

Thanks

@GrantNagel It's been quite a while since I wrote this, I don't know if I have any of the underlying code still around. send me a message and id be happy to troubleshoot with you though!