I have the same error on teams, below is my code, on the emulator it shows nothing but on teams, it gives that operation returned an invalid bad request,

if (reasonintent == "Schedule")
{
//******************
UAT_LUIS_Entity UAT_LUIS = await GetEntityFromLUIS(turnContext.Activity.Text);
List<string> entityList = new List<string>();
String HourFromTime = "", HourToTime = "", MinToTime = "", MinFromTime = "", checkspecificdate = "";
String FromTime = "", ToTime = "", FromTimeHour = "", FromTimeMin = "", ToTimeHour = "", ToTimeMin = "";
for (int i = 0; i < UAT_LUIS.entities.Length; i++)
{
entityList.Add(UAT_LUIS.entities[i].type.ToString().ToLower());
if (UAT_LUIS.entities[i].type.ToString().ToLower() == "room")
{
roomluisname = UAT_LUIS.entities[i].entity.ToString().ToLower();
}
if (UAT_LUIS.entities[i].type.ToString().ToLower() == "date")
{
dateluis = UAT_LUIS.entities[i].entity.ToString().ToLower();
checkspecificdate = "true"
;
}
if (UAT_LUIS.entities[i].type.ToString().ToLower() == "today")
{
dateluis = UAT_LUIS.entities[i].entity.ToString().ToLower();
}
if (UAT_LUIS.entities[i].type.ToString().ToLower() == "the day after tomorrow")
{
dateluis = UAT_LUIS.entities[i].entity.ToString().ToLower();
}
if (UAT_LUIS.entities[i].type.ToString().ToLower() == "tomorrow")
{
dateluis = UAT_LUIS.entities[i].entity.ToString().ToLower();
}
}
String d = dateluis;
if (checkspecificdate == "true")
{
datevar = Convert.ToDateTime(dateluis);
}
else if (dateluis.Contains("today"))
{
datevar = DateTime.Today;
}
else if (dateluis.Contains( "tomorrow"))
{
datevar = DateTime.Today.AddDays(1);
}
else if (dateluis == "the day after tomorrow" || dateluis.Contains("day after tomorrow"))
{
datevar = DateTime.Today.AddDays(2);
}
else
{
datevar = DateTime.Today;
}
DateTime dateobject;
String datestring = "";
if (DateTime.TryParse(datevar.ToString(), out dateobject))
{
datestring = dateobject.ToString("yyyy-MM-ddT");
}
string datevarparticularstart = datestring + "00" + ":" + "00" + ":" + "01-08:00";
string datevarparticularend = datestring + "23" + ":" + "59" + ":" + "00-08:00";
var queryparticulardate = new List<QueryOption>()
{
new QueryOption("startDateTime", datevarparticularstart),
new QueryOption("endDateTime", datevarparticularend)
};
var calendarViewparticulardate = await graphClient.Me.CalendarView
.Request(queryparticulardate)
.GetAsync();
String luiscalenderentity = "";
//***********************
for (int i = 0; i < UAT_LUIS.entities.Length; i++)
{
entityList.Add(UAT_LUIS.entities[i].type.ToString().ToLower());
if (UAT_LUIS.entities[i].entity.ToString().ToLower().Contains("tulip"))
{
luiscalenderentity = "tulip";
}
else if (UAT_LUIS.entities[i].entity.ToString().ToLower().Contains("lotus"))
{
luiscalenderentity = "lotus";
}
else if (UAT_LUIS.entities[i].entity.ToString().ToLower().Contains("snowdrop"))
{
luiscalenderentity = "snowdrop";
}
else if (UAT_LUIS.entities[i].entity.ToString().ToLower().Contains("chanyaky"))
{
luiscalenderentity = "chanyaky";
}
}
string boolvarcheck = "";
if (calendarViewparticulardate.Count != 0)
{
for (int i = 0; i < calendarViewparticulardate.Count; i++)
{
if (calendarViewparticulardate[i].Location.DisplayName.ToLower().Contains(luiscalenderentity))
{
boolvarcheck = "true";
string converttostring1 = "";
DateTime date1;
if (DateTime.TryParse(Convert.ToDateTime(calendarViewparticulardate[i].Start.DateTime).AddHours(-8).ToString(), out date1))
{
converttostring1 = date1.ToString("HH:mm:ss");
}
String vartime1 = converttostring1;
// Convert.ToDateTime(calendarViewdate[0].End.DateTime).AddHours(-8);
string converttostring2 = "";
DateTime date2;
if (DateTime.TryParse(Convert.ToDateTime(calendarViewparticulardate[i].End.DateTime).AddHours(-8).ToString(), out date2))
{
converttostring2 = date2.ToString("HH:mm:ss");
}
String vartime2 = converttostring2;
EventNameschedule.Add(new AdaptiveTextBlock()
{
Text = calendarViewparticulardate[i].Location.DisplayName,
Size = AdaptiveTextSize.Small,
Color = AdaptiveTextColor.Accent
});
Eventschedulestart.Add(new AdaptiveTextBlock()
{
Text = vartime1,
Size = AdaptiveTextSize.Small,
Color = AdaptiveTextColor.Accent
});
Eventscheduleend.Add(new AdaptiveTextBlock()
{
Text = vartime2,
Size = AdaptiveTextSize.Small,
Color = AdaptiveTextColor.Accent
});
Eventschedulesubject.Add(new AdaptiveTextBlock()
{
Text = calendarViewparticulardate[i].Subject,
Size = AdaptiveTextSize.Small,
Color = AdaptiveTextColor.Accent
});
}
}
if (boolvarcheck == "true")
{
card.Body.Add(new AdaptiveContainer()
{
Items = new List<AdaptiveElement>()
{
new AdaptiveColumnSet()
{
Type = "ColumnSet",
Height = AdaptiveHeight.Auto,
Columns=new List<AdaptiveColumn> ()
{
new AdaptiveColumn()
{
Type="Column",
Width="200px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text=luiscalenderentity,//+" Conference Hall",
Weight=AdaptiveTextWeight.Bolder,
Color=AdaptiveTextColor.Good
}
}
} ,
new AdaptiveColumn()
{
Type="Column",
Width="150px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text=datevar.ToString("dd-MM-yyyy"),//DateTime.Today.ToString("dd-MM-yyyy"),
Weight=AdaptiveTextWeight.Bolder,
Color = AdaptiveTextColor.Good
}
}
},
}
},
new AdaptiveColumnSet()
{
Type = "ColumnSet",
Height = AdaptiveHeight.Auto,
Columns=new List<AdaptiveColumn> ()
{
new AdaptiveColumn()
{
Type="Column",
Width="200px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text="Name",
Weight=AdaptiveTextWeight.Bolder,
Color=AdaptiveTextColor.Good
}
}
} ,
new AdaptiveColumn()
{
Type="Column",
Width="80px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text="Start Time",
Weight=AdaptiveTextWeight.Bolder,
Color = AdaptiveTextColor.Good
}
}
},
new AdaptiveColumn()
{
Type="Column",
Width="80px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text="End Time",
Weight=AdaptiveTextWeight.Bolder,
Color = AdaptiveTextColor.Good
}
}
},
}
},
new AdaptiveColumnSet()
{
Type = "ColumnSet",
Height = AdaptiveHeight.Auto,
Columns=new List<AdaptiveColumn> ()
{
new AdaptiveColumn()
{
Type="Column",
Width="200px",
Items=Eventschedulesubject,
},
new AdaptiveColumn()
{
Type="Column",
Width="80px",
Items= Eventschedulestart,
},
new AdaptiveColumn()
{
Type="Column",
Width="80px",
Items= Eventscheduleend,
}
}
},
}
});
}
else
{
card.Body.Add(new AdaptiveContainer()
{
Items = new List<AdaptiveElement>()
{
new AdaptiveColumnSet()
{
Type = "ColumnSet",
Height = AdaptiveHeight.Auto,
Columns=new List<AdaptiveColumn> ()
{
new AdaptiveColumn()
{
Type="Column",
Width="500px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text=" No scheduling for "+luiscalenderentity+" hall",
Weight=AdaptiveTextWeight.Bolder,
Color=AdaptiveTextColor.Good
}
}
}
}
},
}
});
}
}
else
{
card.Body.Add(new AdaptiveContainer()
{
Items = new List<AdaptiveElement>()
{
new AdaptiveColumnSet()
{
Type = "ColumnSet",
Height = AdaptiveHeight.Auto,
Columns=new List<AdaptiveColumn> ()
{
new AdaptiveColumn()
{
Type="Column",
Width="500px",
Items=new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Type="TextBlock",
Text=" No scheduling for "+luiscalenderentity+" hall",
Weight=AdaptiveTextWeight.Bolder,
Color=AdaptiveTextColor.Good
}
}
}
}
},
}
});
}
var attachment1 = new Microsoft.Bot.Schema.Attachment
{
ContentType = AdaptiveCard.ContentType,
Content = card,
};
var reply1 = MessageFactory.Attachment(attachment1);
await turnContext.SendActivityAsync(reply1, cancellationToken);
}