Evaluation in Swagger UI

You can use the Swagger UI to evaluate and explore capabilities of the Veeam Backup for Microsoft 365 REST API. The Swagger UI framework allows you to interact with the 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/index.html

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 the 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, do the following:

  1. From the Select a definition drop-down list, select the REST API version API v8.

Evaluation in Swagger UI 

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

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. 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 

Save the access and refresh tokens locally for further use.

Evaluation in Swagger UI Tip

You can download a server response in the JSON format. To do that, in the expanded method window, click Download in the lower-right corner of the Response body field.

To authorize your access in the Swagger UI, do the following:

  1. In the top-right corner of the Veeam Backup for Microsoft 365 REST API page, click Authorize.
  2. In the Available authorizations dialog, insert the access token saved locally in the Value field.
  3. Click Authorize.

Evaluation in Swagger UI 

  1. Wait for the response from the server, review the information and click Close.

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, do the following:

  1. Expand the Auth resource and click POST /v8/token.
  2. Click Try it out.
  3. From the grant_type drop-down list, select refresh_token.
  4. In the refresh_token field, insert the refresh token that you saved locally.
  5. Click Execute.

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. Save the access and refresh tokens locally for further use.

Sending Request

After you get authorization, you can send HTTP requests to Veeam Backup for Microsoft 365 REST API collections and resources in the Swagger UI.

To send a request, do the following:

  1. Expand the required resource and select the request method.
  2. Click Try it out.
  3. Specify parameter values if required.
  4. Click Execute.

Evaluation in Swagger UI 

Getting Response

The Swagger UI returns a response body as well as a response code and response headers. Additionally the Swagger UI generates a curl command and a URL for your request.

Evaluation in Swagger UI Tip

You can download a server response in the JSON format. To do that, in the expanded method window, click Download in the lower-right corner of the Response body field.

Page updated 8/9/2024

Page content applies to build 8.0.5.20