-
Notifications
You must be signed in to change notification settings - Fork 0
Companies
Max Kovpak edited this page Apr 15, 2020
·
2 revisions
require_once 'vendor/autoload.php';
use Brainfab\MoyGrafik\MoyGrafik;
$OAUTH2_CLIENT_ID = 'your client id';
$OAUTH2_CLIENT_SECRET = 'your client secret';
$client = new MoyGrafik();
$client->setClientId($OAUTH2_CLIENT_ID);
$client->setClientSecret($OAUTH2_CLIENT_SECRET);
$client->authenticate([
'grant_type' => 'password',
'username' => 'your email',
'password' => 'your password',
]);
$companies = $client->companies()->listCompanies();
foreach ($companies as $company) {
echo $company->name . "<br>";
}
require_once 'vendor/autoload.php';
use Brainfab\MoyGrafik\MoyGrafik;
$OAUTH2_CLIENT_ID = 'your client id';
$OAUTH2_CLIENT_SECRET = 'your client secret';
$client = new MoyGrafik();
$client->setClientId($OAUTH2_CLIENT_ID);
$client->setClientSecret($OAUTH2_CLIENT_SECRET);
$client->authenticate([
'grant_type' => 'password',
'username' => 'your email',
'password' => 'your password',
]);
$companyId = $client->companies()->getCompanyIdBySlug('my-company-slug');