code: public function getAccessToken(): ApiAccessToken
      {
          try {
              $accessToken = $this->tokenStorage->getAccessToken();
          } catch (UnableToAcquireAccessToken $e) {
              $accessToken = null;
          }
  
          if ($accessToken && $accessToken->isExpired()) {
              $this->tokenStorage->unsetAccessToken();
              $accessToken = null;
          }
  
          return $accessToken ?: $this->refreshToken();
      }
docs: Get the API access token. This method can be used to verify if provided `ApiSettings` are valid.
  
  @return ApiAccessToken
  @throws RefreshTokenFailed