You are here

private function BackupMigrateDropboxAPI::get_bearer_token in Backup and Migrate Dropbox 7.3

Returns a short lived but not yet expired bearer token.

If a bearer token is stored and not yet expired that is returned, otherwise that bearer token is replaced (and returned) by a new one.

Return value

string A short lived but not yet expired bearer token.

Throws

RuntimeException

1 call to BackupMigrateDropboxAPI::get_bearer_token()
BackupMigrateDropboxAPI::send_message in ./backup_migrate_dropbox.dropbox_api.inc
Sends a request to Dropbox and returns the response.

File

./backup_migrate_dropbox.dropbox_api.inc, line 213

Class

BackupMigrateDropboxAPI
BackupMigrateDropboxAPI contains all the details about the Dropbox api, authorization calls, endpoints, uris, parameters, error handling, and split requests for large uploads/downloads

Code

private function get_bearer_token() {
  $bearer_token = BearerTokenInfos::get($this->destination
    ->get_id());
  return $bearer_token !== NULL ? $bearer_token : $this
    ->refresh_bearer_token();
}