我需要通过电子邮件 ID 通过 Microsoft graph 查询获取单个用户详细信息,任何人都可以帮助我,我在 MS 文档中找不到它。
var users = graphServiceClient.Users.Request().GetAsync().GetAwaiter().GetResult();
Run Code Online (Sandbox Code Playgroud)
这只会带来 100 个用户,我需要通过电子邮件获取用户,这样我才能获取特定用户
使用Microsoft Graph .NET 客户端库清除“简单”字符串属性(例如组的描述)的内容的正确方法是什么?
使用以下代码设置非空值可以正常工作
var patch = new Group();
patch.Description = "your description here";
var req = new GroupRequest(graphClient.Groups["<group id>"].Request().RequestUrl, graphClient, new List<Option>());
req.UpdateAsync(patch).Wait();
Run Code Online (Sandbox Code Playgroud)
但是,如果我将 patch.Description 设置为 "" 我会得到一个异常
代码:Request_BadRequest 消息:为资源“组”的属性“描述”指定的值无效。
如果我将 patch.Description 的值设置为 null(它已经是 Group() 的一个新实例),根本没有任何反应(我也可以在 Fiddler 中看到,补丁请求的正文中不包含任何描述) )。
所以我的问题是,清除值的正确方法是什么?
c# azure office365 azure-active-directory microsoft-graph-api
我尝试使用 API https://dev.onedrive.com/getting-started.htm与 OneDrive 集成
我使身份验证工作,我可以获得帐户中的驱动器列表。当我执行 API 调用 /me/drives 时,我得到了很好的驱动器列表。
但是我找不到如何获取驱动器上的文件夹列表、文件夹的子文件夹等。
从文档中我可以看到有一些 API,但它对我不起作用。 https://dev.onedrive.com/items/list.htm
我必须执行。
GET /drive/items/{item-id}/children
GET /drive/root:/{item-path}:/children
Run Code Online (Sandbox Code Playgroud)
但它不起作用。我有一个驱动器列表中的驱动器 ID。当我执行 GET /drive/items/DRIVEID/children 时出现错误“拒绝访问。您无权执行此操作或访问此资源。”
这个操作怎么做?我应该使用驱动器 ID 还是名称?也许 url 是错误的,如果我有驱动器名称和 ID,那么正确的 url 必须是什么?
当我尝试使用Graph Explorer检索照片时,使用示例帐户效果很好。
但是当我用自己的帐户登录时,它就被破坏了。
当我请求时:
https://graph.microsoft.com/v1.0/me/contacts/{Id}/photo/$value
Run Code Online (Sandbox Code Playgroud)
它返回:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store.",
"innerError": {
"request-id": "ad665ca9-9585-4f7a-9dd1-803061d8baba",
"date": "2018-10-09T15:55:54"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道原因,这让我很困惑。
我正在使用 Microsoft Graph API 将 excel 文件上传到 Onedrive 并将其转换为 PDF。我的服务流量很大,所以我想了解 Microsoft Graph API 的每日限制?我每天可以向 Microsoft Graph 发送多少个请求?
有人已经在 Stackoverflow 上询问过Throttling,但我不太确定 Daily Limitation API?
10 minutes - 10000 requests
1 day (1440 minutes) - 1440000 requests
Run Code Online (Sandbox Code Playgroud)
那是对的吗?
Throttling is done per user per app. The threshold is 10000 requests every 10 minutes.
我正在尝试通过Microsoft Graph REST API检索所有 SharePoint 网站
查看站点资源,我可以看到有一些方法可以获取根站点、获取子站点,还可以按组获取站点。
是否所有 SharePoint 网站(包括组网站)都可以作为根网站的子网站找到?或者我是否需要检索每个组并枚举它们?
当我尝试将$filter条款应用于/beta/groups如下时:
$filter=resourceProvisioningOptions/Any(x:x eq 'Team') and visibility eq 'Private'
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
{
"error": {
"code": "Request_UnsupportedQuery",
"message": "Unsupported or invalid query filter clause specified for property 'visibility' of resource 'Group'.",
"innerError": {
"request-id": "eb6a7c7e-96da-4358-871d-e20ee5f82e2e",
"date": "2020-01-09T23:25:01"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?
在我的项目中,我在 Net Core 3.0 项目中使用 Microsoft Graph Api 连接到 Azure Intune 并添加组和用户。添加包含成员的组时,图形 API 需要用户的 json 表示,如下所示(文档):
var group = new Group
{
// other properties omitted
AdditionalData = new Dictionary<string, object>()
{
{"owners@odata.bind", "[\"https://graph.microsoft.com/v1.0/users/26be1845-4119-4801-a799-aea79d09f1a2\"]"},
{"members@odata.bind", "[\"https://graph.microsoft.com/v1.0/users/ff7cb387-6688-423c-8188-3da9532a73cc\",\"https://graph.microsoft.com/v1.0/users/69456242-0067-49d3-ba96-9de6f2728e14\"]"}
}
};
Run Code Online (Sandbox Code Playgroud)
简要编辑: 我从文档中尝试了上面的代码,用我想要添加的用户替换了 Guid,但这也不起作用,给我同样的错误消息。 结束编辑。
如何在字典中动态添加成员,例如从用户 ID 数组中添加成员?他们似乎使用转义字符,并且使用JsonConvert.SerializeObject(arrayObjectWithIds)似乎不起作用,因为我从 Graph Api 得到了一个格式不正确的 OData 字段:Invalid URL format specified in @odata.bind for members
我拥有的:
string[] memberIds = new string[] { "https://graph.microsoft.com/v1.0/users/123", "https://graph.microsoft.com/v1.0/users/456", "https://graph.microsoft.com/v1.0/users/789" };
string json = JsonConvert.SerializeObject(memberIds);
newGroup.AdditionalData = new …Run Code Online (Sandbox Code Playgroud) c# odata asp.net-core-mvc azure-ad-graph-api microsoft-graph-api
我有以下附件列表要通过邮件发送
要发送小于 4 MB(1MBPDF, 210KBPDF) 的总文件大小,我可以使用这种方法,要发送大文件 (4MBPDF),我正在使用此处提供的解决方案
但是,当我尝试使用大文件方法(示例代码)将三个文件(1MBPDF、210KBPDF、4MBPDF)一起发送时,出现以下错误...
com.microsoft.graph.http.GraphServiceException:错误代码:ErrorAttachmentSizeShouldNotBeLessThanMinimumSize 错误消息:附件大小必须大于最小大小。
POST https://graph.microsoft.com/v1.0/me/messages/AAMkAGNhNWJlNjdkLWNkZTUtNDE1Yy1hYzkxLTkyOWI1M2U3NGQzOABGAAAAAAASIVxVSsS8RI-T3F73mdJZBwANqxyKMlQbSqZO439E21_mAAAAAAEPAAANqxyKMlQbSqZO439E21_mAAAVRY2dAAA=/attachments/microsoft.graph.createUploadSession SdkVersion:图表的Java / V2.3.2授权:[PII_REDACTED] { “attachmentItem”: {“附件类型”:“文件”,“内容[...]
400:错误请求 [...]
如果我在实施该方法时犯了任何错误,请告诉我,或者建议我发送多个大小混合的附件的任何解决方法。
谢谢
microsoft-graph-sdks microsoft-graph-mail microsoft-graph-api
我想将 ngrok 用于 Microsoft Teams 应用程序开发,但它被我们的 FortiGuard 威胁防护阻止,我无法使用标准命令 ngrok http 80 创建隧道。
我应该告诉我们的 FortiGuard 管理员需要更改什么才能允许 ngrok 工作?
谢谢。
ngrok microsoft-teams webfiltering microsoft-graph-api advanced-threat-protection