1. Go to this page and download the library: Download iaematt/cafeapi 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/ */
iaematt / cafeapi example snippets
aematt\CafeApi\Me;
$me = new Me('api.site.com', '[email protected]', '123@mudar');
/** Me */
$user = $me->me();
/** Update */
$user->update([
'first_name' => 'Robson',
'last_name' => 'Leite',
'genre' => 'male',
'date_birth' => '1980-01-02',
'document' => '888888888',
]);
/** Photo */
$user->photo($_FILES['photo']);
/** Test and result */
if ($user->error()) {
$user->error(); /** Object */
} else {
$user->response(); /** Object */
}