Jotform API: Error 520 in downloading attachments with api

  • FBHLTechSupport
    Asked on March 20, 2025 at 3:11 PM

    Hello team,

    Lately I have been getting a 520 status code response when using the GET request to download the files that are attached to a form submission. This used to work without an issue so I'm unsure how to trouble shoot this. Below is an example of the response I get with my initial Get Files call and then when calling the url to download the file.


    I can go to the form submission and download the files from there manually, so the files are not corrupt. Any asssitance would be greatly appreciated.


    EndPoint: https://api.jotform.com/submission/{{ submissionID }}/files?apiKey={{ apiKey }}

    Response: {

        "responseCode": 200,

        "message": "success",

        "content": [

            {

                "id": "8149008611",

                "name": "Filename.pdf",

                "type": "application/pdf",

                "size": "4531357",

                "username": "{{ username }}",

                "form_id": "242403185331043",

                "submission_id": "6174559555194335843",

                "uploaded": "1",

                "date": "2025-03-10 18:45:56",

                "url": "http://www.jotform.com/uploads/{{ username }}/{{ formID }}/{{ submissionID }}/{{ filename.pdf }}

    }

    ],

        "duration": "40.32ms",

        "info": null,

        "limit-left": 49995

    }

    When using the new URL to download the attachment I get an error like this:    

    <h1>Jotform is currently unavailable</h1>

                   <p>Please try again later.</p>

               </div>

               <div class="jf-text">

                   <p>

                       The most likely causes:

                   </p>

                   <ul>

                       <li>The site may be experiencing excessive load</li>

                       <li>The server is down for maintenance</li>

                       <li>There may be a network problem</li>

                   </ul>

               </div>

               <div class="err-box" style="display:none">

                   <div class="cf-error-details cf-error-520">

                       <h1>Web server is returning an unknown error</h1>

                       <p>There is an unknown connection issue between Cloudflare and the origin web server. As a result,

                           the web page can not be displayed.</p>

                       <ul>

                           <li>Ray ID: 92376df399eb60b2</li>

                           <li>Your IP address: 35.134.129.178</li>

                           <li>Error reference number: 520</li>

                           <li>Cloudflare Location: Chicago</li>


  • Lorenz JotForm Support
    Replied on March 20, 2025 at 9:48 PM

    Hi FBHLTechSupport,

    Thanks for reaching out to Jotform Support. I tested the API endpoint, and it appears to work as expected. Check this out:

    Jotform API: Error 520 in downloading attachments with api Image 1 Screenshot 20

    The issue could be temporary only, can you make another GET Request, and see if it'll work now? If the issue persists, I would suggest you create a new API key, and make more tests.

    Give it a try and let us know how it goes.

  • FBHLTechSupport
    Replied on March 21, 2025 at 9:18 AM

    Morning Lorenz,

    I agree the first Get Files API works successfully. It's the second call to download the attachment URL that is causing the error. The on that starts http://www.jotform.com/uploads. Can you please advise?

  • Reban JotForm Support
    Replied on March 21, 2025 at 10:37 AM

    Hi FBHLTechSupport,

    I cloned your form and used the same API link to request the file attachments, but I was able to download it without any issues. Check out the screenshot below for the result:

    Jotform API: Error 520 in downloading attachments with api Image 1 Screenshot 50When I tried to paste the generated URL in my browser, I was able to download the file. Check out the screencast below:

    Jotform API: Error 520 in downloading attachments with api Image 2 Screenshot 61

    Can you also try to paste the generated file URL directly into your browser? This is to see if you can still replicate the issue.

    If the issue is still there, you can also try to disable the requirement to Login to View Uploaded Files. It's easy to do. Let me walk you through it:

    1. Login to your Jotform account on your Desktop (it's not available yet on the Mobile App).

    Jotform API: Error 520 in downloading attachments with api Image 3 Screenshot 72

    2. Click on your Avatar/Profile picture on the right side of the screen, and click on it.

    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.

    Jotform API: Error 520 in downloading attachments with api Image 4 Screenshot 83

    Give it a try and let us know how it goes.

  • FBHLTechSupport
    Replied on March 21, 2025 at 12:01 PM

    Hi Reban,

    I can take the URL from the Postman response, insert it into my browser and can see the attachment. My issue is strictly with the API downloading the attachment. That is the part that is broken.


    I went into my settings and confirmed we do not have the Require log-in checked. Is there a way we can get a call set up so that you can see what is going on?

  • Reban JotForm Support
    Replied on March 21, 2025 at 12:46 PM

    Hi FBHLTechSupport,

    Unfortunately, we don't offer phone support. Although we offer Live Chat Support, there are a limited number of agents available in each time zone. So, sometimes it gets disabled, and you won't see it on our pages. When it is available, you'll see a pop-up if you're logged into your account on most pages, like Form Builder, Jotform Tables, Jotform Inbox, etc. as shown in the lower-right corner of the image below:

    Jotform API: Error 520 in downloading attachments with api Image 1 Screenshot 30If you don't see that option on the page, and you have a question, just reply to this thread, or you can create a Forum Thread from the Contact Us page. We’ll be happy to help.

    Now, coming back to your question. To address the issue you're experiencing with downloading files via API requests, switching the download URL from http to https may resolve the problem. Here's how you can do it:​

    Instead of using this link:

    http://www.jotform.com/uploads/username/formid/submissionid/sample.txt

    Use this link:

    https://www.jotform.com/uploads/username/formid/submissionid/sample.txt

    Check out the screenshot below for the result:

    Jotform API: Error 520 in downloading attachments with api Image 2 Screenshot 41

    Give it a try and let us know how it goes.

  • FBHLTechSupport
    Replied on March 21, 2025 at 1:26 PM

    Hi Reban,

    Changing the call to https worked. Thank you for the suggestion. Odd the url in the submission response is not in https. You can close this out. I'm going to code to switch the http to https if it's found going forward.