Requesting Authorization

The Veeam Backup for Google Cloud REST API accepts the following grant types to authenticate a Veeam Backup for Google Cloud user:

Using Password Grant Type

To obtain authorization tokens, a user sends the HTTP POST request to the api/v1/token/ endpoint.

The request body must contain the grant_type parameter with the specified password value and the credentials of a user created in Veeam Backup for Google Cloud. For more information on how to create users, see User Accounts or the Veeam Backup for Google Cloud User Guide, section Adding User Accounts.

Tip

If you want to change the expiration period of the refresh token to 60 minutes, set the use_short_term_refresh parameter value to true.

A successfully completed operation returns the 200 response code. In the response body, Veeam Backup for Google Cloud returns an access token, its expiration time (in seconds) and a refresh token. The user inserts the access token in headers of further requests to the Veeam Backup for Google Cloud REST API. The refresh token must be saved locally.

To learn how to authorize your access using the password grant type, see Example [Password]. Alternatively, you can use the Swagger UI.

Using MFA Grant Type

Note

MFA is disabled by default. To learn how to enable MFA, see Multi-Factor Authentication or the Veeam Backup for Google Cloud User Guide, section Enabling Multi-Factor Authentication.

If multi-factor authentication (MFA) is enabled for a user, the user must first obtain an mfa token, and then get authorization tokens.

  1. To obtain an mfa token, the user sends the HTTP POST request to the api/v1/token/ endpoint. The request body must contain the grant_type parameter with the specified password value and the credentials of the user.

A successfully completed operation returns the 202 response code. In the response body, Veeam Backup for Google Cloud returns an mfa token.

  1. To obtain an access token and a refresh token, the user must send another HTTP POST request to the api/v1/token/ endpoint. The request body must contain the grant_type parameter with the specified mfa value, the mfa token previously received from the authorization server, and the verification code generated by the authentication application running on the trusted device.

A successfully completed operation returns the 200 response code. In the response body, Veeam Backup for Google Cloud returns an access token, its expiration time (in seconds) and a refresh token. The user inserts the access token in headers of further requests to the Veeam Backup for Google Cloud REST API. The refresh token must be saved locally.

To learn how to authorize your access using the MFA grant type, see Example [MFA]. Alternatively, you can use the Swagger UI.

Using Authorization Code Grant Type

To get authorization using the Authorization Code grant type, a user must first obtain an authorization code, and then get authorization tokens.

  1. To obtain the authorization code, an authorized user sends the HTTP POST request to the /api/v1/authorization_code endpoint.

A successfully completed operation returns the 200 response code. In the response body, Veeam Backup for Google Cloud returns an authorization code, which can be used by another user or client application to get authorization in the Veeam Backup for Google Cloud REST API. By default, the Veeam Backup for Google Cloud authorization code expires in 60 seconds.

  1. To obtain an access token and a refresh token, a user or client application sends the HTTP POST request to the /api/v1/token endpoint. The request body must contain the grant_type parameter with the specified authorization_code value and the authorization code previously issued by the authorization server.

A successfully completed operation returns the 200 response code. In the response body, Veeam Backup for Google Cloud returns an access token, its expiration time (in seconds) and a refresh token. The user inserts the access token in headers of further requests to the Veeam Backup for Google Cloud REST API. The refresh token must be saved locally.

To learn how to authorize your access using the Authorization Code grant type, see Example [Authorization Code]. Alternatively, you can use the Swagger UI.

Requesting AuthorizationExample [Password]

Requesting AuthorizationExample [MFA]

Requesting AuthorizationExample [Authorization Code]