PHP code example of romeritocampos / suap-php-api

1. Go to this page and download the library: Download romeritocampos/suap-php-api library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

romeritocampos / suap-php-api example snippets


 
	merito\Suap\SuapClient;
	$client = new SuapClient;
	#user credentials
	$user = readline();
	$pass = readline();
	#true or false
	$res = $client->auth ($user, $pass);
	#generated token
	$token = $client->getToken();
	echo $token . "\n";

    	 Romerito\Suap\SuapClient;
	$client = new SuapClient;
	$user = readline();
	$pass = readline();
	if ($client->auth ($user, $pass)) {
		$result = $client->get("/minhas-informacoes/meus-dados/");
		var_dump($result);
	}


	omerito\Suap\SuapClient;
	use Romerito\Suap\ProfessorClient;
	$client = new SuapClient;
	$user = readline();
	$pass = readline();
	$client->auth($user, $pass);
	$pclient = new ProfessorClient($client);
	$object = $pclient->getProfessorObject();
	echo  get_class($object) . "\n";