Office 365管理API是否有CORS支持?
我知道它支持邮件,日历和联系人API。但是,当我尝试通过客户端代码调用Management API时,它以CORS错误结尾,如下所示。
错误: SEC7120:[CORS]在“ https://mysite.sharepoint.com / activity /”处的跨源资源的Access-Control-Allow-Origin响应标头中未找到源“ https://mysite.sharepoint.com” feed / subscriptions / list”。
我的Ajax调用如下:
$.ajax({
url:"https://manage.office.com/api/v1.0/<tenant_id>/activity/feed/subscriptions/list",
method: "GET",
crossDomain: true,
headers: {
"Accept": "application/json;odata=verbose",
"Content-Type" : "application/json;odata=verbose",
"Authorization": "Bearer eyJ0..Tg",
"Access-Control-Allow-Origin": "*",
},
success: onQuerySucceeded,
error: onQueryFailed
});
function onQuerySucceeded(response) {
alert('success');
}
function onQueryFailed(xhr, ajaxOptions, thrownError) {
alert('Error!');
}
请帮助!!在此先感谢!