} public function __destruct() { parent::__destruct(); } } try { // File to upload. $fileName = 'smile.png'; $filePath = getcwd() . '/images/' . $fileName; $fileType = 'image/png'; $fileDescription = 'A test document that will make you smile.'; $inspectionID = ''; // Enter an inpsection ID to test. $params = array(); $path = '/v4/inspections/' . $inspectionID . '/documents'; // Create new Inspections object. $inspection = new Inspections($app_id, $app_secret, $token, $environment, $agency_name); // Upload new inspection doc $response = $inspection->uploadInspectionDocuments($path, AuthType::$AccessToken, $params, $fileName, $fileType, $filePath, $description); // Vie response var_dump($response); } catch (ConstructException $ex) { $details = json_decode($ex->getMessage()); echo "Code: " . $ex->getCode() . "\n"; echo "Message: " . $details->message . "\n"; echo "TraceID: " . $details->traceId . "\n\n"; } catch (Exception $ex) { echo "Code: " . $ex->getCode() . "\n"; echo $ex->getMessage() . "\n\n"; }
/** * @return \yii\db\ActiveQuery */ public function getInspections() { return $this->hasMany(Inspections::className(), ['C_ID' => 'C_ID']); }