Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 984 Bytes

token-usage.md

File metadata and controls

39 lines (29 loc) · 984 Bytes

Getting Token

Authorization

<?php
require 'vendor/autoload.php';

$token = new \Symplicity\Outlook\Token([outlookClientId], [outlookClientSecret], ['logger' => $log]);
$token->getAuthorizationUrl($state, $redirectUrl);

Request

Every request either requesting or refreshing a token will return a Token Entity

<?php
require 'vendor/autoload.php';

$token = new \Symplicity\Outlook\Token([outlookClientId], [outlookClientSecret], ['logger' => $log]);
$tokenEntity = $token->request($code, $redirectUrl);
$accessToken = $tokenEntity->getAccessToken(); 

Refresh

<?php
require 'vendor/autoload.php';

$token = new \Symplicity\Outlook\Token([outlookClientId], [outlookClientSecret], ['logger' => $log]);
$tokenEntity = $token->refresh($refreshToken, $redirectUrl);
$newAccessToken = $tokenEntity->getAccessToken();