AuthorizationToken
in package
implements
DataModel
Authorization data including the OAuth bearer token, expiry, and refresh token.
Tags
Table of Contents
Interfaces
Properties
- $accessToken : string|null
- $createdAt : DateTimeImmutable|null
- $expiresIn : int|null
- $refreshToken : string|null
- $scopes : string|null
Methods
- __construct() : mixed
- getContent() : array<string|int, mixed>
- Get the data as an array to POST or PUT to FreshBooks, removing any read-only fields.
- getExpiresAt() : DateTimeImmutable
Properties
$accessToken
public
string|null
$accessToken
The authorized bearer token from the OAuth2 token response.
$createdAt
public
DateTimeImmutable|null
$createdAt
Time the bearer token was created.
$expiresIn
public
int|null
$expiresIn
Number of seconds since creation that the token will expire at.
Please note AuthorizationToken::getExpiresAt() which calculates the expiry time from this and createdAt.
$refreshToken
public
string|null
$refreshToken
The authorized refresh token from the OAuth2 token response.
$scopes
public
string|null
$scopes
The scopes that the token is authorized for.
Methods
__construct()
public
__construct([array<string|int, mixed> $data = [] ]) : mixed
Parameters
- $data : array<string|int, mixed> = []
getContent()
Get the data as an array to POST or PUT to FreshBooks, removing any read-only fields.
public
getContent() : array<string|int, mixed>
Return values
array<string|int, mixed>getExpiresAt()
public
getExpiresAt() : DateTimeImmutable
Return values
DateTimeImmutable —Time the bearer token expires at.