Help Center
Choose product document...
Veeam Backup & Replication 9.5
RESTful API Reference

Step 2. Perform Logon

Before you can start working with Veeam Backup Enterprise Manager RESTful API resources, you must log on to Veeam Backup Enterprise Manager and create a new logon session.

  1. When you access the Veeam Backup Enterprise Manager RESTful API by its base URL, Veeam Backup Enterprise Manager returns a representation with a link to a list of existing sessions and links to creating a new logon session. The SupportedVersion sections in the representation indicate versions of Veeam Backup Enterprise Manager RESTful API. You can create a new logon session to work with resources that are supported in the latest or the specified version of RESTful API.

To work with all Veeam Backup Enterprise Manager RESTful API resources available in the current version of Veeam Backup & Replication and to access a complete set of actions that can be performed with those resources, create a new logon session using the link to the latest version of the /sessionMngr/ resource. For example, to work with RESTful API resources supported in Veeam Backup & Replication 9.5, create a new logon session using one of the following links:

  • http://localhost:9399/api/sessionMngr/?v=latest
  • http://localhost:9399/api/sessionMngr/?v=v1_3

If a previous version of Veeam Backup & Replication is installed on your Veeam backup server, you should create a new logon session using the link to the corresponding version of Veeam Backup Enterprise Manager RESTful API. To learn more, see Appendix C. Veeam Backup RESTful API Versions.

Request:

GET http://localhost:9399/api/

 

Response:

200 Success

 

Response Body:

<EnterpriseManager xmlns="http://www.veeam.com/ent/v1.0">
 <Links>
   <Link Rel="Down" Type="LogonSessionList" Href="http://localhost:9399/api/logonSessions" />
   <Link Rel="Create" Type="LogonSession" Href="http://localhost:9399/api/sessionMngr/?v=latest" />
 </Links>
 <SupportedVersions>
   <SupportedVersion Name="v1">
     <Links>
       <Link Rel="Create" Type="LogonSession" Href="http://localhost:9399/api/sessionMngr/?v=v1" />
     </Links>
   </SupportedVersion>
   <SupportedVersion Name="v1_1">
     <Links>
       <Link Rel="Create" Type="LogonSession" Href="http://localhost:9399/api/sessionMngr/?v=v1_1" />
     </Links>
   </SupportedVersion>
   <SupportedVersion Name="v1_2">
     <Links>
       <Link Rel="Create" Type="LogonSession" Href="http://localhost:9399/api/sessionMngr/?v=v1_2" />
     </Links>
   </SupportedVersion>
   <SupportedVersion Name="v1_3">
     <Links>
       <Link Rel="Create" Type="LogonSession" Href="http://localhost:9399/api/sessionMngr/?v=v1_3" />
     </Links>
   </SupportedVersion>
 </SupportedVersions>
</EnterpriseManager>

  1. As there are no existing logon sessions, you need to create a new one. A new logon session is created by sending the POST HTTP request to the /sessionMngr/ resource. In the header of the request, provide user credentials of the account you plan to use for the current logon session. To make up the credentials string:
  1. Construct a string in the username:password format.
  2. Encode the string with base64 encoding.
  3. Add the Authorization header to the POST HTTP request. In the value of the header, specify Basic <encoded_string>:

Authorization: Basic QWRtaW5pc3RyYXRvcjpUcmVzc3Bhc3Mx

  1. Send the composed POST HTTP request to the /sessionMngr/ resource. Veeam Backup Enterprise Manager will return a list of resources with which you can work using Veeam Backup Enterprise Manager RESTful API. In the UserName element, Veeam Backup Enterprise Manager will return a name of the user who is currently logged on. In the header of the response, Veeam Backup Enterprise Manager will supply a newly generated authorization token for the created logon session:

Request:

POST http://localhost:9399/api/sessionMngr/?v=v1_3

 

Request Header:

Authorization: Basic QWRtaW5pc3RyYXRvcjpUcmVzc3Bhc3Mx

 

Response:

201 Created

 

Response Header:

X-RestSvcSessionId: O9Msj3rq7EGUhtSMBQx+mw==

 

Response Body:

<LogonSession xmlns="http://www.veeam.com/ent/v1.0" Type="LogonSession" Href="http://localhost:9399/api/logonSessions/5496707f-c814-47ce-8d6d-110aa03cec03">
 <Links>
   <Link Rel="Up" Type="EnterpriseManager" Href="http://localhost:9399/api/" />
   <Link Rel="Down" Type="BackupServerReferenceList" Href="http://localhost:9399/api/backupServers" />
   <Link Rel="Down" Type="ManagedServerReferenceList" Href="http://localhost:9399/api/managedServers" />
   <Link Rel="Down" Type="JobReferenceList" Href="http://localhost:9399/api/jobs" />
   <Link Rel="Down" Type="FailoverPlanReferenceList" Href="http://localhost:9399/api/failoverPlans" />
   <Link Rel="Down" Type="HierarchyRootReferenceList" Href="http://localhost:9399/api/hierarchyRoots" />
   <Link Rel="Down" Type="RepositoryReferenceList" Href="http://localhost:9399/api/repositories" />
   <Link Rel="Down" Type="BackupReferenceList" Href="http://localhost:9399/api/backups" />
   <Link Rel="Down" Type="RestorePointReferenceList" Href="http://localhost:9399/api/restorePoints" />
   <Link Rel="Down" Type="VmRestorePointReferenceList" Href="http://localhost:9399/api/vmRestorePoints" />
   <Link Rel="Down" Type="VAppRestorePointReferenceList" Href="http://localhost:9399/api/vAppRestorePoints" />
   <Link Rel="Down" Type="ReplicaReferenceList" Href="http://localhost:9399/api/replicas" />
   <Link Rel="Down" Type="VmReplicaPointReferenceList" Href="http://localhost:9399/api/vmReplicaPoints" />
   <Link Rel="Down" Type="CatalogVmReferenceList" Href="http://localhost:9399/api/catalog/vms" />
   <Link Rel="Down" Type="BackupJobSessionReferenceList" Href="http://localhost:9399/api/backupSessions" />
   <Link Rel="Down" Type="RestoreSessionReferenceList" Href="http://localhost:9399/api/restoreSessions" />
   <Link Rel="Down" Type="ReplicaJobSessionReferenceList" Href="http://localhost:9399/api/replicaSessions" />
   <Link Rel="Down" Type="BackupTaskSessionReferenceList" Href="http://localhost:9399/api/backupTaskSessions" />
   <Link Rel="Down" Type="ReplicaTaskSessionReferenceList" Href="http://localhost:9399/api/replicaTaskSessions" />
   <Link Rel="Down" Type="EnterpriseSecuritySettings" Href="http://localhost:9399/api/security" />
   <Link Rel="Down" Type="WanAcceleratorReferenceList" Href="http://localhost:9399/api/wanAccelerators" />
   <Link Rel="Down" Type="BackupFileReferenceList" Href="http://localhost:9399/api/backupFiles" />
   <Link Rel="Down" Type="TaskList" Href="http://localhost:9399/api/tasks" />
   <Link Rel="Down" Type="QueryService" Href="http://localhost:9399/api/querySvc" />
   <Link Rel="Down" Type="LookupService" Href="http://localhost:9399/api/lookupSvc" />
   <Link Rel="Down" Type="Report" Href="http://localhost:9399/api/reports/summary" Name="Summary" />
   <Link Rel="Down" Type="BackupServerList" Href="http://localhost:9399/api/backupServers?format=Entity" />
   <Link Rel="Down" Type="ManagedServerList" Href="http://localhost:9399/api/managedServers?format=Entity" />
   <Link Rel="Create" Href="http://localhost:9399/api/backupServers?action=create" />
   <Link Rel="Down" Type="JobList" Href="http://localhost:9399/api/jobs?format=Entity" />
   <Link Rel="Down" Type="FailoverPlanList" Href="http://localhost:9399/api/failoverPlans?format=Entity" />
   <Link Rel="Down" Type="HierarchyRootList" Href="http://localhost:9399/api/hierarchyRoots?format=Entity" />
   <Link Rel="Down" Type="RepositoryList" Href="http://localhost:9399/api/repositories?format=Entity" />
   <Link Rel="Down" Type="BackupList" Href="http://localhost:9399/api/backups?format=Entity" />
   <Link Rel="Down" Type="RestorePointList" Href="http://localhost:9399/api/restorePoints?format=Entity" />
   <Link Rel="Down" Type="VmRestorePointList" Href="http://localhost:9399/api/vmRestorePoints?format=Entity" />
   <Link Rel="Down" Type="VAppRestorePointList" Href="http://localhost:9399/api/vAppRestorePoints?format=Entity" />
   <Link Rel="Down" Type="ReplicaList" Href="http://localhost:9399/api/replicas?format=Entity" />
   <Link Rel="Down" Type="VmReplicaPointList" Href="http://localhost:9399/api/vmReplicaPoints?format=Entity" />
   <Link Rel="Down" Type="CatalogVmList" Href="http://localhost:9399/api/catalog/vms?format=Entity" />
   <Link Rel="Down" Type="BackupJobSessionList" Href="http://localhost:9399/api/backupSessions?format=Entity" />
   <Link Rel="Down" Type="RestoreSessionList" Href="http://localhost:9399/api/restoreSessions?format=Entity" />
   <Link Rel="Down" Type="ReplicaJobSessionList" Href="http://localhost:9399/api/replicaSessions?format=Entity" />
   <Link Rel="Down" Type="BackupTaskSessionList" Href="http://localhost:9399/api/backupTaskSessions?format=Entity" />
   <Link Rel="Down" Type="ReplicaTaskSessionList" Href="http://localhost:9399/api/replicaTaskSessions?format=Entity" />
   <Link Rel="Down" Type="WanAcceleratorList" Href="http://localhost:9399/api/wanAccelerators?format=Entity" />
   <Link Rel="Down" Type="VCloudService" Href="http://localhost:9399/api/vCloud" />
   <Link Rel="Down" Type="BackupFileList" Href="http://localhost:9399/api/backupFiles?format=Entity" />
   <Link Rel="Down" Type="CloudConnectService" Href="http://localhost:9399/api/cloud" />
   <Link Rel="Delete" Href="http://localhost:9399/api/logonSessions/5496707f-c814-47ce-8d6d-110aa03cec03" />
 </Links>
 <UserName>SRV13\Administrator</UserName>
 <SessionId>5496707f-c814-47ce-8d6d-110aa03cec03</SessionId>
</LogonSession>

  1. You must copy the obtained X-RestSvcSessionId header and send it in the header of all subsequent requests to Veeam Backup Enterprise Manager.

Step 2. Perform Logon Note:

To create a new logon session for a tenant, you need to provide tenant credentials in the body of the POST HTTP request to the URL of the /sessionMngr/ resource. To learn more, see Tenant Logon Session.

 

Veeam Large Logo

User Guide for VMware vSphere

User Guide for Microsoft Hyper-V

Enterprise Manager User Guide

Veeam Cloud Connect Guide

Veeam Backup Explorers User Guide

PowerShell Reference

RESTful API Reference

Veeam Backup FREE Edition User Guide

Veeam Backup for Microsoft Office 365

Veeam ONE Documentation

Veeam Agent for Windows Documentation

Veeam Agent for Linux Documentation

Veeam Management Pack Documentation