API POST /submission/{id} not working

  • joewetzel
    Asked on September 13, 2024 at 9:52 AM

    For things with multiple fields like names and time, the updates are not working.

    I can see the summitted name update, which is really weird, because I don't see how these fields are connected, but also I don't have a field for the submitter.

    I'm creating the submission automatically after two other forms are complete. The previous forms are phases of the project and all forms are connected by a unique ID. They python script takes data from forms 1 and 2 and creates a new submission for form 3. I'm trying to copy the name engineer name from form 2 to form 3, but it doesn't work. For other fields it does work, for example if I update the status it updates without errors. I've tried many variations and have even used the online jotform API (https://api.jotform.com/docs/#post-submission-id) which gives me the same results as my python code, which is I can update some fields, 'status' but not the 'test engineer" first or last name. I've been trying to get this to work all day yesterday and hoping maybe it's something I'm doing wrong (because if it's on the jotform side I'm afraid I'll just get another this feature is not fully supported response again).

    I'm not getting an error responses, the error is that when I check the submission contents the update never happened. Same code works for some fields.

    Python Code:

    # JotForm API Key

    api_key = 'secret'

    submission_id = '6017870794418946327'


    # Update data for field ID 3 (Test Engineer Name)

    update_data = {

      'submission[4][first]': 'Joe',

      'submission[4][last]': 'Wetzel',

      'submission[new]': '1'

    }


    # POST request with form data

    response = requests.post(

        f'https://api.jotform.com/submission/{submission_id}?apiKey={api_key}',

      data=update_data

    )


    if response.status_code == 200:

      print('Submission updated successfully!')

    else:

      print(f'Error updating submission: {response.text}')

  • Jovito JotForm Support
    Replied on September 13, 2024 at 10:17 AM

    Hi Joe,

    Thanks for reaching out to Jotform Support. I understand the issue, but I’ll need a bit of time to work out a solution. I’ll get back to you shortly.

    Thanks for your patience, we appreciate it.


  • Jovito JotForm Support
    Replied on September 13, 2024 at 12:17 PM

    Hi Joe,

    We tested your python code and copied it on our end. Upon testing, we added our API key and the submission ID of our code and it seems to work. Check out the image below:

    python ./18981611.py
    Submission updated successfully!

    After that, we check our submission in Jotform Inbox, and it seems that the submission is updated as expected. Check out the image below:

    API POST /submission/{id} not working Image 1 Screenshot 20

    Can you share with us the steps you made when testing the code on your end? Can you provide us with a screen recording using Loom or any other platform and send the link to us so we can check? Can you also share the form URL so we can check? We have a guide on how to get it on your form.

    Once we hear back from you, we can help you with this.

  • Joe
    Replied on September 13, 2024 at 1:28 PM

    I wonder if it's related to the field was left blank when originally submitted and then I'm trying to update the answer but there is not "answer" field when I download the json. I tried updating 4 (test engineer) and 5 report author. Neither one updated.


  • Sidharth JotForm Support
    Replied on September 13, 2024 at 2:48 PM

    Hi Joe,

    I wasn't able to test the Python code, but I did test the API for editing submissions, and it's working as expected. I cloned your form and submitted the same data, but with a different PDF document uploaded. I successfully called the API using Postman, and I was able to update the first and last name as well as the submission status. Check out the screencast below to see the result:

    API POST /submission/{id} not working Image 1 Screenshot 20

    As you can see, the Test Engineer's name was Sidharth C and the submission was marked as read. After updating the submission via the API, the name was changed and the submission status was updated as well. I recommend reviewing the Python code to check why it's not updating the submission.

    Let us know if you have any other questions.

Your Answer