Exemplo n.º 1
0
 /**
  * Delete report
  * http://api.jotform.com/docs/#delete-report-id
  *
  * @param String $reportId
  * @return Object
  * @throws Exception \JotForm\Exception\ClientException
  */
 public function deleteReport($reportId = null)
 {
     if (!isset($reportId)) {
         throw new \JotForm\Exception\ClientException('Exception: Required parameter missing');
     }
     // Construct request
     $request = new \JotForm\Request();
     $request->setMethod('DELETE');
     $request->setEndpoint('/report/' . $reportId);
     try {
         $response = $this->client->executeRequest($request);
         return $response;
     } catch (\Exception $e) {
         throw new \JotForm\Exception\ClientException($e->getMessage());
     }
 }
Exemplo n.º 2
0
 /**
  * Get plan details
  * http://api.jotform.com/docs/#system-plan-planName
  *
  * @param String $planName
  * @return Object
  * @throws Exception \JotForm\Exception\ClientException
  */
 public function getPlanDetails($planName = null)
 {
     if (!isset($planName)) {
         throw new \JotForm\Exception\ClientException('Exception: Required parameter missing');
     }
     // Construct request
     $request = new \JotForm\Request();
     $request->setMethod('GET');
     $request->setEndpoint('/system/plan/' . $planName);
     try {
         $response = $this->client->executeRequest($request);
         return $response;
     } catch (\Exception $e) {
         throw new \JotForm\Exception\ClientException($e->getMessage());
     }
 }
Exemplo n.º 3
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());
     }
 }
Exemplo n.º 4
0
 /**
  * Add a submission to a form
  * http://api.jotform.com/docs/#post-form-id-submissions
  *
  * @param String $formId
  * @param Array $submission
  * @return Object
  * @throws Exception \JotForm\Exception\ClientException
  */
 public function addFormSubmission($formId = null, $submission = [])
 {
     if (!isset($formId) || !isset($submission)) {
         throw new \JotForm\Exception\ClientException('Exception: Required parameters missing');
     }
     // Construct request
     $request = new \JotForm\Request();
     $request->setMethod('POST');
     $request->setEndpoint('/form/' . $formId . '/submissions');
     $request->setData($submission);
     try {
         $response = $this->client->executeRequest($request);
         return $response;
     } catch (\Exception $e) {
         throw new \JotForm\Exception\ClientException($e->getMessage());
     }
 }