今天我正在使用新的(测试版)Office 365统一API,我发现了一个非常奇怪的行为,可能是微软方面的一个错误.
当我尝试使用统一API删除日历时,我收到409错误,当我尝试创建一个传递已存在名称的新日历时,我得到了同样的错误.这里是REST详细信息.
请求:
DELETE https://graph.microsoft.com/beta/me/calendars/AAMkAGZlO...6AAA= HTTP/1.1
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJ...
Host: graph.microsoft.com
Run Code Online (Sandbox Code Playgroud)
响应:
HTTP/1.1 409 Conflict
{"error":{"code":"ErrorFolderExists","message":"A folder with the specified name already exists."}}
Run Code Online (Sandbox Code Playgroud)
根据规范(https://msdn.microsoft.com/office/office365/APi/calendar-rest-operations#Deletecalendars),应返回204.
有没有办法在Microsoft端创建一个bug,比如bug跟踪器?
非常感谢提前
我试图通过JavaScript与adal.js和jQuery(OAuth的隐流)集成到Office365 API,但我有问题想创建我的用户日历事件.我的现有代码在检索电子邮件和日历事件时工作正常,但是当我尝试创建日历事件时,我始终得到"403 - 禁止"响应.
该代码是实时的,并在http://oauth.idippedut.dk/oauth.html上工作.我正在访问https://outlook.office.com/api/v2.0/me/events上的Office 365 API端点.
我在Office365/Azure租户Active Directory中的应用程序上的"委派权限"配置如下:

我们的Office365/Azure租户Active Directory中的应用程序上的"应用程序权限"配置如下:

jQuery请求是这样的:
var event = {
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2016-01-21T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2016-01-21T19:00:00",
"TimeZone": "Pacific Standard Time"
},
"Attendees": [
{
"EmailAddress": {
"Address": "jesper@lundstocholm.dk",
"Name": "Janet Schorr"
},
"Type": "Required"
}
]
};
// Create calendar …Run Code Online (Sandbox Code Playgroud) javascript azure-active-directory adal office365api microsoft-graph
我目前正在开发一种解决方案,该解决方案通过Microsoft Graph API检索电子邮件。在2015年11月,Microsoft宣布已准备好投入生产,我在另一篇论坛文章中读到,如果您现在开始使用Microsoft API进行开发,则应该使用Graph API,因为这是未来。
除了一件事情,一切都进行得很好,那就是接下来的事情。
我必须检索电子邮件。这些电子邮件中当然有附件。这些附件有些不同。fileAttachment(图像,文档等),referenceAttachments和itemAttachments(outlook-item)。这里的问题与itemAttachments有关。itemAttachment可以是从约会到其他消息的任何内容。这里的问题是,我无法以某种适用于fileAttachments的方式获取和检索contentBytes。与itemAttachment相关的对象是outlookItem。还有一个页面对此OutlookItem进行了描述,但是缺少示例和详细信息。用户权限设置为Mail.Read和Mail.ReadWrite。
链接:概述:http : //graph.microsoft.io/docs/overview/overview获取outlookItem(空?):
我得到的示例呼叫和响应。请注意附件的类型。 https://graph.microsoft.com/v1.0 / users / / messages / / attachments
{
"@odata.context": "link",
"value": [
{
"@odata.type": "#microsoft.graph.fileAttachment",
"id": "AAMkAGU2NmIwMTcxLTljYzUtNGRiMi1hZjczLTllNzhiZDRiNWZlZABGAAAAPAD_Lx_gimDGRqSr98J_O_e6BwDcWyYHlO7rS5_XpLHCx6NSAAIMC0V-AADcWyYHlO7rS5_XpLHCx6NSAAIMC6RgAAABEgAQAGhN_vm1RlBPt7V4N9a89UY=",
"lastModifiedDateTime": "2016-01-13T14:25:33Z",
"name": "image001.png",
"contentType": "image/png",
"size": 5077,
"isInline": true,
"contentId": "image001.png@01D14E16.A3A32480",
"contentLocation": null,
"contentBytes": "iVBORw0KGgoAAAANSUhEUgAAAKAAAACCCAIAAABOyVRHAAAAAXNSR0IArs4c6QAAEndJREFUeF7tXQ1QFFe2bkbU... (truncated)"
},
{
"@odata.type": "#microsoft.graph.fileAttachment",
"id": "AAMkAGU2NmIwMTcxLTljYzUtNGRiMi1hZjczLTllNzhiZDRiNWZlZABGAAAAPAD_Lx_gimDGRqSr98J_O_e6BwDcWyYHlO7rS5_XpLHCx6NSAAIMC0V-AADcWyYHlO7rS5_XpLHCx6NSAAIMC6RgAAABEgAQAFnSLgIC5wZOosmLtBWK8gE=",
"lastModifiedDateTime": "2016-01-13T14:25:34Z",
"name": "image002.png",
"contentType": "image/png",
"size": 3722,
"isInline": true,
"contentId": "image002.png@01D14E16.A3A32480",
"contentLocation": null,
"contentBytes": "iVBORw0KGgoAAAANSUhEUgAAAPoAAABSCAYAAAB9o8m+AAAAGXRFWHRTb... (truncated)"
},
{
"@odata.type": "#microsoft.graph.fileAttachment",
"id": "AAMkAGU2NmIwMTcxLTljYzUtNGRiMi1hZjczLTllNzhiZDRiNWZlZABGAAAAPAD_Lx_gimDGRqSr98J_O_e6BwDcWyYHlO7rS5_XpLHCx6NSAAIMC0V-AADcWyYHlO7rS5_XpLHCx6NSAAIMC6RgAAABEgAQANOuw7m8sW1Ot3MivYQ5OYU=",
"lastModifiedDateTime": "2016-01-13T14:25:24Z",
"name": …Run Code Online (Sandbox Code Playgroud) 朋友们
我正在尝试从Word加载项调用API,并收到“访问被拒绝”错误。我做了一些研究,看来是“跨源资源共享”的原因。
1. Web API
我在“ http:// localhost:61546 / api / ORG_NAMES ” 本地托管Web API 2,并且已启用CORS接受所有来源,请参见下面的WebApiConfig。
public static class WebApiConfig
{
public static void Register(HttpConfiguration config)
{
// Web API configuration and services
var cors = new EnableCorsAttribute("*", "*", "*");
config.EnableCors(cors);
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
}
}
Run Code Online (Sandbox Code Playgroud)
2.测试申请
为了测试此API以确保它支持CORS,我已经在下面的页面中创建并托管在localhost:52799 / home.html上,我能够获得预期的响应。我已经在IE 10和Chrome中对此进行了测试。
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
$("button").click(function () {
var obj;
.support.cors …Run Code Online (Sandbox Code Playgroud) ms-word asp.net-web-api asp.net-web-api2 office365api office-js
我想使用REST API在SharePoint文档库中的特定文件夹中获取名为"Pages"的项目
我使用下面的rest API,我可以获取文档库中的所有项目
https:// spsite/_api/web/lists/getByTitle('Pages')/ items
但我还没有找到REST API,我可以在SharePoint文档库中的特定文件夹中获取
谢谢先进的Laleh
Microsoft Graph API错误地将Word doc文件附件作为从/ me/messages端点返回的消息实体返回.
重现的场景如下:
向您自己发送一封包含一个或多个Word doc文件附件的电子邮件(或让其他人向您发送电子邮件)
在Graph Explorer中运行以下查询:https://graph.microsoft.com/v1.0/me/messages
请注意,将有一个对象代表电子邮件本身(这是正确的行为)和一个或多个对象,它们是文件附件的表示.
微软的某个人可以尽快与我联系吗?这是API中的一个主要错误,可能会导致大多数使用它的应用程序出现问题.
PS此问题之前已经提出并修复,但它已经重新开始了... 文件附件在Microsoft Graph API中显示为消息实体
我是否还建议围绕此问题编写一些自动化测试以防止它在将来再次发生?
我无法从office365日历API获取令牌,从最近7到8个月它正在工作但突然我得到错误"期望一个数组或一个可迭代的对象,但得到[对象空]".
你们可以在这里看到我的代码
var oauth2 = require("simple-oauth2")(ConfigOutlookCredentials);
var scopes = ["openid","offline_access","profile", //here 'profile' is added bz not able to getting EmailId in this function getEmailFromIdToken.
"https://outlook.office.com/mail.read",
"https://outlook.office.com/calendars.readwrite"
];
function getTokenFromCode(auth_code,callback) {
logger.MessageQueueLog.log("info","auth_code: "+auth_code+" || redirectUri: "+redirectUri+" || scopes: "+scopes);
oauth2.authCode.getToken({
code: auth_code,
redirect_uri: redirectUri,
scope: scopes.join(" ")
}, function(error, result) {
logger.MessageQueueLog.log("info","error: "+util.format('%j',error.message)+" || result: "+util.format('%j',result));
if (error) {
return callback(error,null);
} else {
var token = oauth2.accessToken.create(result);
return callback(null,token);
}
});
}
Run Code Online (Sandbox Code Playgroud)
我在重定向到我的rediredct Url并且相同的代码传递到上面的函数"getTokenFromCode"后得到代码,我仍然得到错误即" 期望数组或可迭代对象但得到[对象空] ".
请帮我弄清楚问题.提前致谢.
我们已经登录办公室365登陆我们的网站工作了几个月,突然间,它已经坏了.
截至今天上午(英国时间),我们开始收到"AADSTS700023:使用提供的授权码请求访问令牌时,输入参数范围的提供值不能为空.请指定有效范围." 我们通过https://login.microsoftonline.com/common/oauth2/v2.0/token请求令牌时出现错误
看看文档看来,范围是必需的并且没有被传递,所以无论它工作了几个月,我都添加了它.现在我得到了一个不同的错误..
AADSTS700022:输入参数范围的提供值无效,因为它包含多个资源.范围https://outlook.office.com/mail.send mail.readwrite calendars.readwrite tasks.readwrite contacts.readwrite openid profile offline_access无效.
当我们首先调用授权端点时,这是传递的范围,并且从该调用返回时很好,但是当我们尝试获取令牌时它会失败.
目前是否存在针对365的常见登录问题,或者是否存在我做错的事情以及微软决定"修复"他们的结局?
我正在使用Graph API来获取/列出和创建日历事件。最近我尝试使用Beta API,最近在尝试创建日历事件时遇到以下错误:
The property 'iCalUId' does not exist on type 'Microsoft.OutlookServices.Event
Run Code Online (Sandbox Code Playgroud)
我正在使用以下地址执行POST请求:
https://graph.microsoft.com/beta/Users('<user-id>')/calendars/<id>/events
Run Code Online (Sandbox Code Playgroud)
与包含“ iCalUId”属性的JSON对象。几周前使用Graph API的Beta版检索了该对象。当时,创建具有相同请求的日历事件的工作正常。
文档指出存在这种属性。
问题是-我做错什么了吗?还是最近更改的Beta API?如果以后-我怎么知道是否对beta API进行了更改?
从本周开始gateway timeout,当我的邮件搜索找不到任何结果时,我突然从Graph中获取信息。
我正在使用这样的查询:
https://graph.microsoft.com/v1.0/users/shared@notreal.com/mailFolders/AllItems/messages?$search="participants:some.person@fake.com"&$select=from,subject,HasAttachments,Id,SentDateTime&$top=100
Run Code Online (Sandbox Code Playgroud)
这是一个图查询,它从shared@notreal.com发送者或接收者包括的Office 365邮箱中请求最多100封电子邮件some.person@fake.com。shared@notreal.com是与拨打电话的帐户共享的邮箱。
我的应用已通过oauth2身份验证代码流进行了身份验证,并已获得所有必要的权限。
This has been working for about a year. But starting a few days ago, this query only succeeds if results are found. When no results are found, the query takes 30 seconds, Graph returns UnknownError and the response is 504 with reasonphrase Gateway Timeout.
It seems as though something has changed in the Graph API - or perhaps in the Office 365 API, …
office365api ×10
office365 ×4
access-token ×1
adal ×1
azure ×1
calendar ×1
javascript ×1
login ×1
ms-office ×1
ms-word ×1
node.js ×1
oauth-2.0 ×1
office-js ×1
rest ×1
sharepoint ×1