public function tearDown() { Config::getInstance(); Config::setUser(""); Config::setUsername(""); Config::setPassword(""); Config::setServer(""); }
private function setFlow($jwt) { if (is_null($jwt)) { $this->mode = self::OAUTH2_PASSWORD_FLOW; self::$password = Config::getPassword(); self::$username = Config::getUsername(); } else { $this->mode = self::OAUTH2_JWT_FLOW; } }
function doConfig() { $api = 'https://ssalinasdemo.iformbuilder.com/'; $profileId = '161521'; $username = '******'; $password = '******'; Config::getInstance(); Config::setUser($profileId); Config::setUsername($username); Config::setPassword($password); Config::setServer($api); $this->configured = true; }
/** * Set the iFormBuilder user * * @param null $profile * @param null $server * * @throws \Exception */ protected function setUser($profile = null, $server = null) { Config::getInstance(); $this->urlComponents["profiles"] = Config::getUser(); $this->urlComponents["server"] = Config::getServer(); }
<?php // make sure to include zerion autoloader require_once 'iform/zerion_autoload.php'; // the auto loader will fetch this classes // all file loading will be taken care of for you use Iform\Resources\IformResource; use Iform\Creds\Config; // find this credentials in the api apps section of iformbuilder admin tool $config = array('profile' => 'your profile id', 'server' => 'your server name', 'client' => 'your client key', 'secret' => 'your secret key'); // pass config to api method Config::api($config); //user container to initialize resource //connection and jwt authentication will be take care of through the iForm resource container! $pages = IformResource::pages(); // Now your ready to interact with the api! // Grab the first ten pages in your account // return json by default echo $pages->first(10)->fetchAll();