/**
  * Update submission data
  * http://api.jotform.com/docs/#post-submission-id
  *
  * @param String $submissionId
  * @param Array $submission
  * @return Object
  * @throws Exception \JotForm\Exception\ClientException
  */
 public function updateSubmissionData($submissionId = null, $submission = [])
 {
     if (!isset($submissionId) || !isset($submission)) {
         throw new \JotForm\Exception\ClientException('Exception: Required parameters missing');
     }
     // Construct request
     $request = new \JotForm\Request();
     $request->setMethod('POST');
     $request->setEndpoint('/submission/' . $submissionId);
     $request->setData($submission);
     try {
         $response = $this->client->executeRequest($request);
         return $response;
     } catch (\Exception $e) {
         throw new \JotForm\Exception\ClientException($e->getMessage());
     }
 }
Esempio n. 2
0
 /**
  * Create a new form
  * http://api.jotform.com/docs/#post-user-forms
  *
  * @param Array $formProperties
  * @return Object
  * @throws Exception \JotForm\Exception\ClientException
  */
 public function createUserForm($formProperties = [])
 {
     // Construct request
     $request = new \JotForm\Request();
     $request->setMethod('POST');
     $request->setEndpoint('/user/forms');
     $request->setData($formProperties);
     try {
         $response = $this->client->executeRequest($request);
         return $response;
     } catch (\Exception $e) {
         throw new \JotForm\Exception\ClientException($e->getMessage());
     }
 }