Mailium Oauth Client provides easy to use wrappers for authorizing your application and getting the tokens required to talk to the API.
An example application can be found under example directory.
This is a simple working application that utilizes most of the features of the client.
composer require mailium/oauth-client-php
$oauthClient = new MailiumOauthClient();
$oauthClient->setClientID("YOUR_CLIENT_ID");
$oauthClient->setClientSecret("YOUR_CLIENT_SECRET");
$oauthClient->setRedirectUri("YOUR_REDIRECT_URI");
// Scopes that your application need
$oauthClient->addScope(MailiumOauthClient::SCOPE_BASIC);
$oauthClient->addScope(MailiumOauthClient::SCOPE_CAMPAIGN_READ);
$oauthClient->addScope(MailiumOauthClient::SCOPE_SUBSCRIBER_LIST_READ);
// Set the callback method to store the oauth token
$oauthClient->setTokenStoreCallbackFunction("storeToken");
$authorizationUrl = $oauthClient->createAuthorizationUrl();
$oauthClient->authorize($authorizationCode);
$oauthClient->getResourceOwner();