Evaluation in Swagger UI

You can use the Swagger UI to evaluate and explore capabilities of Veeam Backup for Microsoft 365 REST API. The Swagger UI framework allows you to interact with Veeam Backup for Microsoft 365 REST API in a sandbox UI. The Swagger UI visually presents API specification files and allows you to work with resources.

All resources and methods are expandable. When you expand a method, you get a full description of available parameters and an automatically generated example. You can also send requests and see response messages.

To access the Swagger UI for Veeam Backup for Microsoft 365 REST API, in a web browser, navigate to the following URL:

https://<hostname>:<port>/swagger/ui/index

where:

  • <hostname> is the DNS name or IP address of the server where Veeam Backup for Microsoft 365 is installed.
  • <port> is the port number. The default port number is 4443.

Obtaining Authorization Token

To start working with Swagger UI, you must first authorize your access to Veeam Backup for Microsoft 365 REST API resources.

Authorization process involves obtaining an authorization token that must be used in all requests during the session.

To obtain an authorization token, perform the following steps:

  1. In Swagger UI, select the API version v7 on top of the page.

Evaluation in Swagger UI 

  1. Expand the Auth resource and click POST /v7/token.
  2. From the grant_type drop-down list, make sure that the password (default) value is selected.
  3. In the username and password fields, specify credentials for authenticating to the Veeam Backup for Microsoft 365 server.
  4. Click Try it out.

Evaluation in Swagger UI 

Evaluation in Swagger UI Note

The client_id and assertion parameters are used in the scenario of data restore for tenant Microsoft 365 organizations with modern app-only authentication and enabled security defaults. For more information, see Authorization for Organizations with Modern App-Only Authentication.

Adding Authorization Token

Wait for the response from the server. A successfully completed operation returns the 200 OK response code. In the response body, Veeam Backup for Microsoft 365 returns an access token, its expiration time and a refresh token.

Evaluation in Swagger UI 

Check that the access token is inserted in the api_key field in the Bearer <access_token> format and click Explore.

Evaluation in Swagger UI 

Using Refresh Token

When the access token expires, you can either obtain a new access token or renew the access token using the refresh token.

To use the refresh token, perform the following steps:

  1. Expand the Auth resource and click POST /v7/token.
  2. From the grant_type drop-down list, select refresh_token.
  3. In the refresh_token field, insert the refresh token.
  4. Click Try it out.

Evaluation in Swagger UI 

Wait for the response from the server. A successfully completed operation returns the 200 OK response code and a new pair of tokens in the response body.

Sending Request

To send a request, select the required resource and request method, enter parameters if required and click Try it out.

Evaluation in Swagger UI 

Getting Response

The server returns a response to the successful request command.