问题描述
我正在使用HTTP客户端向Graph API发出请求,以创建具有多个通道的团队,所有内容均正确创建,但是通道显示为“隐藏”。
我已经尝试在频道上使用“ isFavoriteByDefault”属性,但没有任何效果。
我通过创建没有渠道的团队然后分别创建每个渠道来使其工作,但这太慢了。
如何在一个请求中创建团队和所有渠道,但使其可见?
我的代码:
HttpClient client = Client("https://graph.microsoft.com/v1.0/teams",token);
var data = new
{
odataTemplateProperty = "https://graph.microsoft.com/v1.0/teamstemplates('standard')",visibility = "Private",displayName = Team.Name,description = Team.Description,channels = Channels.Select(x => new
{
odataProperty = "#Microsoft.Teams.Core.channel",membershipType = "private",isFavoriteByDefault = true,displayName = x.Name,description = x.Description
}).ToList()
};
string jsonData = JsonConvert.SerializeObject(data).Replace("odataProperty","@odata.type").Replace("odataTemplateProperty","[email protected]");
StringContent content = new StringContent(jsonData,Encoding.UTF8,"application/json");
var response = Post(client,content).Result;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)