code: func CalculateDashboardDiff(c *m.ReqContext, apiOptions dtos.CalculateDiffOptions) Response {
  
  	guardianBase := guardian.New(apiOptions.Base.DashboardId, c.OrgId, c.SignedInUser)
  	if canSave, err := guardianBase.CanSave(); err != nil || !canSave {
  		return dashboardGuardianResponse(err)
  	}
  
  	if apiOptions.Base.DashboardId != apiOptions.New.DashboardId {
  		guardianNew := guardian.New(apiOptions.New.DashboardId, c.OrgId, c.SignedInUser)
  		if canSave, err := guardianNew.CanSave(); err != nil || !canSave {
  			return dashboardGuardianResponse(err)
  		}
  	}
  
  	options := dashdiffs.Options{
  		OrgId:    c.OrgId,
  		DiffType: dashdiffs.ParseDiffType(apiOptions.DiffType),
  		Base: dashdiffs.DiffTarget{
  			DashboardId:      apiOptions.Base.DashboardId,
  			Version:          apiOptions.Base.Version,
  			UnsavedDashboard: apiOptions.Base.UnsavedDashboard,
  		},
  		New: dashdiffs.DiffTarget{
  			DashboardId:      apiOptions.New.DashboardId,
  			Version:          apiOptions.New.Version,
  			UnsavedDashboard: apiOptions.New.UnsavedDashboard,
  		},
  	}
  
  	result, err := dashdiffs.CalculateDiff(&options)
  	if err != nil {
  		if err == m.ErrDashboardVersionNotFound {
  			return Error(404, "Dashboard version not found", err)
  		}
  		return Error(500, "Unable to compute diff", err)
  	}
  
  	if options.DiffType == dashdiffs.DiffDelta {
  		return Respond(200, result.Delta).Header("Content-Type", "application/json")
  	}
  
  	return Respond(200, result.Delta).Header("Content-Type", "text/html")
  }
docs: // POST /api/dashboards/calculate-diff performs diffs on two dashboards