Download uploaded PDF files via API

  • Sandra_Schmitt
    Gefragt am 19. Mai 2023 um 11:35

    Sehr geehrte Damen und Herren,

    Ich frage mich, ob es möglich ist die von usern hochgeladenen Dokumente über die api abzufragen. Es gibt zwar, so wie ich das gesehen habe, die option alle submissions zu sehen aber ich habe nichts dazu gefunden, wie man ein pdf, dass passwort geschützt ist, herunterzuladen.

    mit freundlichen Grüßen,

    Rainer Schnittert

    Globemee

  • Billy Jotform Support
    Geantwortet am 20. Mai 2023 um 08:52

    Hi Sandra,

    Thank you for reaching out to Jotform Support. Our German support is currently not available so we'll respond to you in English. Should you wish to receive support in your native language, please let us know.

    Based on the result of Deepl's translation, it seems like you want to download your uploaded files via API. We have an endpoint for this particular use case, please check our resource here. It returns the link to the file(other attributes as well), not actually download it. Here's a sample result:

    Download uploaded PDF files via API Image 1 Screenshot 20

    It also looks like you want to download the PDF output of your form based. If that's the case, please use the endpoint below:

    https://www.jotform.com/server.php?action=getSubmissionPDF&sid=SubmissionID&formID=FormID

    or

    https://www.jotform.com/pdf-submission/SubmissionID

    Reach out again if you need any other help.

  • Sandra_Schmitt
    Geantwortet am 20. Mai 2023 um 10:34

    Hi billiy,

    in our case the pdf is, as you said as a link, inside an excel sheet with all the submissions. The link is in the format https://www.jotform.com/uploads/Sandra_Schmitt/xxxxxx/xxxxxxxxxxxxxxx/CV-AFR-xx.pdf so i do have the link for the download but if i try to fetch it without being logged in (Like with my script) it returns error 404. So how exactly do i request it without getting the error? And is the authentication the same like with the api?

    EDIT: the download is needed because we need to scan the user uploaded pdfs for a few parameters

  • Billy Jotform Support
    Geantwortet am 21. Mai 2023 um 05:26

    Hi Sandra,

    Thanks for getting back to us. Authentication is also provided and I apologize if I wasn't able to mention that earlier. Please check the methods here.

    Reach out again if you need any other help.

  • Sandra_Schmitt
    Geantwortet am 21. Mai 2023 um 09:26

    I still did not quite catch how to download the submitted files. The endpoints you provided only generate a pdf with the data from the submission but for the user submitted pdfs it also only displays a link which i cannot access

  • Dagmar_B
    Geantwortet am 22. Mai 2023 um 02:43

    Hi Rainer,

    I am referring to what oyu mentioned in your second to last answer. You wrote that trying to fetch the link without being logged in gives you an 404 error.

    To stop our system from asking you to login to see/download your pdfs, we just need to disable the requirement to Login to View Uploaded Files. It's easy to do, but we'll need to do that on the Desktop version of Jotform because it's not available yet on the Jotform Mobile App. Let me walk you through it:

    1. Login to your Jotform account.
    2. Hover your mouse over your Avatar/Profile picture on the right side of the screen.
    3. In the dropdown, click on Settings, or click on this link to go directly to your Settings page.
    4. Now, go to the Security tab and uncheck the box next to Require Login to View Uploaded Files under the Privacy section.

    Download uploaded PDF files via API Image 1 Screenshot 20

    That's it. Now, you won't have to login to see/download files uploaded with your submissions.

    Give it a try and let us know if you need any help.

  • Sandra_Schmitt
    Geantwortet am 22. Mai 2023 um 06:20

    The problem is, we need the password protection because of GDPR since we store very sensitive data. That's why i asked if there is a way to authenticate with an api or something simliar

  • Felizio Jotform Support
    Geantwortet am 22. Mai 2023 um 08:07

    Hi Rainer,

    Thanks for reaching out to Jotform Support. I've reached out to our related team for further checking and I've just been informed that actually, there is a way to access and download the file if you use /user/login API to log in without disabling the Require Login to View Uploaded Files option. By using /user/login, you can add the file information to the file request that you've sent, in that way, you will be able to download the file. Please check out the API Authentication page for more information.

    You can also contact our developers to help you with API-related inquiries via this email: api@jotform.com.

    Let us know if you have any other questions.