API: Requests to get a form submission does not return submission data if requested 1 second after the submission..

  • fixationdev
    Asked on January 22, 2019 at 3:38 PM

    Hello, 

    We're running into an issue on our production account, and I'm hoping someone can share some insight. 

    We have a form with a WebHook integration which calls one of our own endpoints.

     

    When our endpoint is called, we make a request to JotForm's API to get the form submission (https://api.jotform.com/docs/#submission-id). When this happens, it is usually about 1 second AFTER the form is submitted to JotForm.

     

    The problem is, seemingly randomly, we'll get a response back from JotForm that does not contain any answers in the form. We get the full JSON structure of the form itself, but without any answers. When we check the submission in JotForm, all of the answers are there.

     

    Is this a timing issue? Do we need to wait longer than 1 second to request the submission from JotForm? If so, how long do we need to wait? This has happened 3 times now and we need to get to the bottom of it.

     

    I've attached a screenshot showing the JSON from our original request to your API, which clearly shows it does NOT include the "DealershipName" answer - though it is there in the JotForm submission.

     

    Thanks for any advice,

    Lloyd Hanneman

    Jotform Thread 1708996 Screenshot
  • Jed_C
    Replied on January 22, 2019 at 5:35 PM

    Can you please share the line of script that executes the API. We can escalate it and have our dev team check and test the code.

    You can also reach out our API team via email at api@jotform.com.

    Looking forward for your response. 

  • fixationdev
    Replied on January 22, 2019 at 6:40 PM

    By "executes the API" do you mean our call to the JotForm API? We're just calling the REST API endpoint that I linked to above.


    This is the code that retrieves the submission JSON from JotForm:


    1548200393jfapi Screenshot 10

  • Jed_C
    Replied on January 22, 2019 at 8:08 PM

    I cloned your form and tested it using my account API and submission and it returns the correct dealershipname.

    1548205614JotForm API   Google Chrome 20 Screenshot 10

    I also check your account API and submission and it also does returns the value.

    1548205664JotForm API   Google Chrome 20 Screenshot 21

    Did you check if you have the correct API key? 

  • fixationdev
    Replied on January 22, 2019 at 9:23 PM

    Yes, the API key is correct. And the API requests work, though it appears that if I request the submission from the API immediately after the form is submitted to JotForm, the data does not always come back. There seems to be a timing issue, but I can't find any documentation to suggest that is the case.


    Again, to reiterate:


    1. Form is submitted to JotForm

    2. WebHook integration in form sends request to My Custom Site

    3. My Custom Site receives request from Webhook, and then calls the JotForm REST API to pull in the submission data

    4. Sometimes form fields are missing in the response from the JotForm REST API. Then, if I call the REST API again later (after some time has passed), it will always work as expected.


    I'd like to avoid building in some "try again" logic into my app if at all possible, so I'm wondering how long we need to wait after a form is submitted to JotForm before we try and query the submission from your REST API. Hope that makes sense.

  • Jed_C
    Replied on January 22, 2019 at 10:32 PM

    I have escalated your concern to our L2 team. Unfortunately, I cannot provide an estimated time frame on when our L2 team be available to respond to your question. I can only assure you that your concern has been forwarded to them.

    In case there's any update on to this, you will receive a response in this thread. We thank you for your patience in the meantime.