Veeam Backup for Microsoft Office 365 RESTful API: Workflow examples

Veeam Backup for Microsoft Office 365 RESTful API: Workflow examples

Over the past few weeks, I’ve explained on how to get started with the RESTful API and took a closer look on creating and managing your infrastructure as well as the restore process. The following blog post contains 2 complete workflows where we combine all this to make it even more clear on the steps required to get from A to Z.

Workflow 1: Create and start a job

Backup job creation workflow

The above image explains the steps we need to perform to create and start the job.

  1. Get authentication token via “POST /<VERSION>/token
  2. Get the specific organization ID via “GET /<VERSION>/Organizations
  3. Get the specific backup repository ID via “GET /<VERSION>/BackupRepositories
  4. Create the job via “POST /<VERSION>/Organizations/<ORGANIZATIONID>/Jobs” (this requires a JSON with the correct information and the organization ID).
  5. Modify the schedule via “PUT /<VERSION>/Jobs/<JOBID>
  6. Start the job via “POST /<VERSION>/Jobs/<JOBID>” (this requires the following JSON: { “start”: null })

As you can see, there are 6 requests which are performed to create and start the job however step 5 is optional.

Workflow: Mail restore example

Mail restore workflow

If you want to restore an e-mail from scratch the flow requires 6 steps as well based upon your needs.

  1. Get authentication token via “POST /<VERSION>/token
  2. Get the specific organization ID via “GET /<VERSION>/Organizations
  3. Start the restore session via “POST /<VERSION>/Organizations/<ORGANIZATIONID>/Action” (this requires a JSON with the correct information and the organization ID)
  4. Get the mailbox ID via “GET /<VERSION>/RestoreSession/<RESTORESESSIONID>/Organization/Mailboxes
  5. Explore the backup for a folder or item via “GET /<VERSION>/RestoreSession/<RESTORESESSIONID>/Organization/Mailboxes/<MAILBOXID>/Folders” or “GET /<VERSION>/RestoreSession/<RESTORESESSIONID>/Organization/Mailboxes/<MAILBOXID>/Items
  6. Perform the restore via one of the following options:
    1. Item restore: “POST /<VERSION>/RestoreSessions/<RESTORESESSIONIDID>/Organization/Mailboxes/<MAILBOXID>/Items/Action” (this requires a JSON with the correct information and the restore session ID as well as the mailbox ID)
    2. Folder restore: “POST /<VERSION>/RestoreSessions/<RESTORESESSIONIDID>/Organization/Mailboxes/<MAILBOXID>/Folders/Action” (this requires a JSON with the correct information and the restore session ID as well as the mailbox ID)

As you can see from the above workflows, in general it takes just a few steps to perform the final result. In both examples, we did a fresh authentication however this can be cached via your client and skipped to lower the amount of steps needed.

What’s next?

In the final part, we will go over additional settings for the Veeam Explorers and the Veeam Backup for Microsoft Office 365 console.

Missed a part?

Niels Engelen on GithubNiels Engelen on Twitter
Niels Engelen
Working as a Principal Analyst in Product Management for Veeam Software with an interest in anything virtual and cloud with a strong focus on AWS, Azure and Microsoft 365. He is also a VMware Certified Professional, a Veeam Certified Architect and gained the VMware vExpert award (2012-2022).
Comments are closed.