Anything wrong with the API for updating submissions?

  • Profile Image
    paulninja
    Asked on September 17, 2017 at 01:19 PM

    I've been testing it but I'm not able to successfully update a record

    even though I'm using the right api key with full access.

     

    What should be the payload? Should I use the name of the fields or the number key?

  • Profile Image
    paulninja
    Answered on September 17, 2017 at 01:27 PM

    Please close. I got it resolved by using 'submission' as the payload.

     

    Sorry, I still am having issues. Anyone here who can show how to do API update using Guzzle Client.

     

    I tried this and it's failing:

          // update submission with mollie_payment_id

          $client = new HttpClient;

          $client->request(

            'POST', 'https://api.jotform.com/submission/'.$submission['submission_id'].'?apiKey='.$this->jf_api_key, ['submission[7]' => $mollie_payment->id]);

  • Profile Image
    paulninja
    Answered on September 17, 2017 at 01:59 PM

    Or should I do this payload?

    ['submission'=> ['7'=>'11'] ]

    My field is question #7

  • Profile Image
    paulninja
    Answered on September 17, 2017 at 02:16 PM

    Alright, I was able to get this done using post_params in Guzzle.

     

    For others who will encounter the same issue, just do this:

    $client->request(

            'POST', 

            'https://api.jotform.com/submission/{submission_id}?apikey={apikey}',

            [

                'form_params' => [

                    'submission[7]' => 'bar',

                ]

     

            ]);

  • Profile Image
    Jan
    Answered on September 17, 2017 at 03:25 PM

    Thank you for sharing your knowledge. We are glad to hear that you were able to fix the issue.

    If you need any help, let us know. You may also contact our API team at api@jotform.com.