遗憾的是,Office API的某些功能在所有环境中的行为都不完全相同(例如:Excel Online和Excel 2013中的格式化).此外,Excel 2013中没有一些不错的新功能,但在Excel 2016中可用(Excel.js)
当然,我可以告诉用户他们只能在2016年使用我的应用程序,而不是实现在所有环境中都不完全支持的东西.
我更愿意向Excel 2013的用户提供我的应用程序,即使他们没有办法(或倾向于)升级到2016年.我宁愿优雅地降级我的功能列表在功能较少的环境中,而不是将应用程序的功能限制为整个)
它很容易封装与文档的所有交互,并根据环境运行不同的代码.也就是说,如果我知道我所处的确切环境.当前的office.js是否提供了一种发现主机应用程序的版本和上下文(在线/离线)的简洁方法?我在office.context等等找不到任何东西.
在网上有一些关于黑客攻击整个.getContext链条的建议,但这些似乎是"无证件"的,所以我对此并不满意.
有什么建议?
POST https://graph.microsoft.com/v1.0/groups/4a3c5f77-463e-XXXXXX-fa8XXXXXX/calendar/events
Accept: application/json
Authorization: Bearer <Token>
Content-Type: application/json; charset=utf-8
{
"originalStartTimeZone": "UTC",
"originalEndTimeZone": "UTC",
"start": {
"dateTime": "2015-12-03T09:30:00-00:00",
"timeZone": "UTC"
},
"end": {
"dateTime": "2015-12-03T10:30:00-00:00",
"timeZone": "UTC"
},
"responseStatus": {
"response": "Accepted",
"time": "2015-12-01T18:34:00-08:00"
},
"reminderMinutesBeforeStart": 15,
"isReminderOn": true
}
Run Code Online (Sandbox Code Playgroud)
错误:
{
"error": {
"code": "ErrorInternalServerError",
"message": "The SMTP address has no mailbox associated with it.",
"innerError": {
"request-id": "f62423b0-0ade-494d-8c8c-1b56db60b524",
"date": "2015-12-02T10:39:44"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我试过下面提到的两个帖子,
POST /groups/<id>/events
POST /groups/<id>/calendar/events
Run Code Online (Sandbox Code Playgroud)
我尝试了不同的组类型,包括安全性,已启用邮件和统一组,但我看到相同的错误消息,任何帮助将不胜感激.
是否有任何门户可以让我们检查不同 Microsoft Graph 端点的实时状态?像我们为 Azure 提供的东西?
最近,当访问来自印度的一些 Graph 端点时,我们504在随机端点上得到了很多,有时我们也会得到503.
几个月前,我们所有的电话都由南印度数据中心响应,现在所有电话都由北欧(有时是西欧)数据中心响应。
南印度数据中心是否存在一些问题,或者因为我们的 Azure AD 应用程序托管在欧洲数据中心而导致呼叫被定向?
我正在构建一个使用Microsoft Graph登录的企业应用程序.成功签名后,我想使用令牌发送给Firebase Auth进行身份验证(这样我就可以保护对数据库的访问).
成功登录后收到的令牌无法直接用于Firebase.
获取项目的服务器密钥:
- 转到项目设置中的"服务帐户"页面.
- 单击"服务帐户"页面的Firebase Admin SDK部分底部的"生成新私钥".
- 新服务帐户的公钥/私钥对会自动保存在您的计算机上.将此文件复制到您的身份验证服务器
第三点说你需要输入密钥到认证服务器.这可能使用Microsoft Graph或Azure AD吗?
Firebase为您提供的密钥是JSON文件.我已经检查了Microsoft App注册门户,它允许您编辑应用程序Manifest,但没有运气.
该JSON文件如下所示:
{
"type": "service_account",
"project_id": "APP_ID",
"private_key_id": "KEY_ID_VALUE",
"private_key": "-----BEGIN PRIVATE KEY----<KEY VALUE>-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-0ubvc@********.iam.gserviceaccount.com",
"client_id": "XXXXXXXXXXXX",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://accounts.google.com/o/oauth2/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-0ubvc%XXXXXXXX.iam.gserviceaccount.com"
}
Run Code Online (Sandbox Code Playgroud)
我似乎无法找到任何涵盖此问题的github项目或stackoverflow线程.
如何使用MS Graph或Azure AD接收自定义令牌?
azure-active-directory firebase-authentication microsoft-graph
我需要能够使用Microsoft Graph API在ASC/DESC的两个方向上获取事件.我正在尝试使用以下API来实现这一目标:
https://graph.microsoft.com/v1.0/me/events?$orderby=start
Run Code Online (Sandbox Code Playgroud)
但是,当我执行请求时,我收到以下错误:
{
"error": {
"code": "BadRequest",
"message": "The $orderby expression must evaluate to a single value of primitive type.",
"innerError": {
"request-id": "c00d676d-ef8e-418b-8561-80e08729da71",
"date": "2017-11-16T13:31:59"
}
}
}
Run Code Online (Sandbox Code Playgroud)
另外,我试图直接访问日期:
https://graph.microsoft.com/v1.0/me/events?$orderby=start.dateTime
Run Code Online (Sandbox Code Playgroud)
得到以下错误:
{
"error": {
"code": "BadRequest",
"message": "The child type 'start.dateTime' in a cast was not an entity type. Casts can only be performed on entity types.",
"innerError": {
"request-id": "240342f5-d7f6-430b-9bd0-190dc3e1f73b",
"date": "2017-11-16T13:32:39"
}
}
}
Run Code Online (Sandbox Code Playgroud)
有没有办法按ASC/DESC顺序按日期对事件进行排序?
我想在OneDrive REST API上使用checkout/checkin功能:https: //docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
我面临两个问题:
第一个问题 - 文件信息API返回publication属性published,即使手动检出文件也是如此
请求:
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID?select=name,id,publication
响应:
{
"id": "01KJOOXJHF77OPSR7HWVCKSTHBQJQZEBJI",
"name": "diamond.mmap",
"publication": {
"level": "published",
"versionId": "2.0"
}
}
Run Code Online (Sandbox Code Playgroud)
第二期 - 结账/签到端点的奇怪响应:
我正在使用此处定义的端点 https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
例如
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID/checkout
回复:
{
"error": {
"code": "BadRequest",
"message": "Unsupported segment type. ODataQuery: sites/fe688d8ed4a2/drive/items/01KJOQZEBJI/checkout",
"innerError": {
"request-id": "a7d18555-3e74-4aea-ad92-539481f6c33b",
"date": "2018-02-21T09:17:00"
}
}
}
Run Code Online (Sandbox Code Playgroud)
有没有想过我错过了什么?
使用 Microsoft Graph 更新多选列表项字段的正确 JSON 语法是什么?
多项选择字段返回一个 json 字符串数组,例如:
得到:/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}
"CAG_x0020_Process_x0020_Status": [
"Proposed Funding - Customer Billed",
"Proposed Funding - Sales Funded",
"SOW - Needed"
]
Run Code Online (Sandbox Code Playgroud)
但是,当使用相同的语法更新字段时,会返回 400 无效请求。
修补:/v1.0/sites/{siteId}/lists/{listId}/items/{itemId}/fields
"CAG_x0020_Process_x0020_Status": [
"Proposed Funding - Customer Billed",
"Proposed Funding - Sales Funded",
"SOW - Needed"
]
Run Code Online (Sandbox Code Playgroud)
返回错误:
{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
"innerError": {
"request-id": "2251e25f-e4ce-491f-beb9-e463c7d8d5af",
"date": "2018-05-16T15:16:23"
}
}
}
Run Code Online (Sandbox Code Playgroud)
我可以更新请求的所有其他字段,但最后一个字段阻碍了应用程序的发布。
我一直在使用从示例创建的库,该库允许我使用Azure Active Directory验证.NET核心Web应用并利用各种OpenIdConnectOptions事件(例如OnTokenValidated)向主体添加某些声明,并将该数据添加到类似于身份的数据库,因此API可以基于调用者的令牌对调用者进行基于策略的确定。
但是我宁愿使用Microsoft.AspNetCore.Authentication.AzureAD.UINuGet软件包,也不愿使用我的自定义版本,我只是不确定如何访问和访问事件OpenIdConnectOptions。
我不知道这不是可以完成的事情,还是我对依赖注入没有足够的了解以了解如何做到这一点。
还是我应该考虑在流程的其他部分添加索赔等?
public static AuthenticationBuilder AddAzureAD(
this AuthenticationBuilder builder,
string scheme,
string openIdConnectScheme,
string cookieScheme,
string displayName,
Action<AzureADOptions> configureOptions) {
AddAdditionalMvcApplicationParts(builder.Services);
builder.AddPolicyScheme(scheme, displayName, o => {
o.ForwardDefault = cookieScheme;
o.ForwardChallenge = openIdConnectScheme;
});
builder.Services.Configure(
TryAddOpenIDCookieSchemeMappings(scheme, openIdConnectScheme, cookieScheme));
builder.Services.TryAddSingleton<IConfigureOptions<AzureADOptions>, AzureADOptionsConfiguration>();
// They put in their custom OpenIdConnect configuration, but I can't see how to get at the events.
builder.Services.TryAddSingleton<IConfigureOptions<OpenIdConnectOptions>, OpenIdConnectOptionsConfiguration>();
builder.Services.TryAddSingleton<IConfigureOptions<CookieAuthenticationOptions>, CookieOptionsConfiguration>();
builder.Services.Configure(scheme, configureOptions);
builder.AddOpenIdConnect(openIdConnectScheme, null, o => { …Run Code Online (Sandbox Code Playgroud) 我正在尝试通过Microsoft Graph获取电子邮件别名:
https://graph.microsoft.com/v1.0/me?$select=proxyAddresses
Run Code Online (Sandbox Code Playgroud)
这适用于我的Office 365帐户(商业帐户),但我无法获得个人帐户(outlook.com,hotmail.com)的别名.我也找不到任何关于此的综合文档.
如何使用Microsoft Graph API将 Office365 用户导入/订阅在 iCal 格式的 URL 上托管的日历?例如,假设我有一个托管在https://example.org/events.ical上的日历,并且我希望此日历显示在 Office365 上托管的用户 Outlook 中?
如果我手动执行此操作,我会遵循这些说明。但我找不到执行此操作的图形 API。
执行 AzureAD 身份验证/权限/令牌不是问题,我可以正常工作。只是Office365上的Outlook调用哪个API。
office365 ×2
asp.net-core ×1
c# ×1
json ×1
office-js ×1
office365api ×1
onedrive ×1
rest ×1
sharepoint ×1