从各种客户端在线访问共享点 [英] Accesing sharepoint online from various clients

查看:376
本文介绍了从各种客户端在线访问共享点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个sharepoint在线网站,我正在使用公告。

I have a sharepoint online site were I'm using announcements. These announcements I would like to consume in a Cordova app and also on a HTML5 site that I have on some info screens.

我一直在寻找使用REST服务和使用REST服务,应用程式。

I have been looking into using the REST service and app for sharepoint.

范例:

var requestUri = 'https://site.sharepoint.com/_api/web/lists(guid\'someGuid')/items'; 
var requestHeaders = { 'accept': 'application/json;odata=verbose' }; 
$.ajax(
    { 
        url: requestUri, 
        contentType: 'application/json;odata=verbose', 
        headers: requestHeaders, 
        success: function (response){
            console.log(response);
        }, 
        error: function(error) {
            console.log(error);
    } 
 });

当我运行这个我得到:
没有访问控制允许原'报头存在于所请求的资源上。因此不允许访问原始null。

When I run this I get the: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

我知道我可以尝试在sharepoint上启用CORS,或使用JSONP。

I know I can look into trying to enable CORS on sharepoint, or use JSONP.

我想知道我在这里走的路径是否是正确的路径,还是最好创建自己的WebService并获取数据?

I was wondering if the path I'm going down here are the correct path or would it be better to create my own WebService and get the data through that?

任何更好的方法?

感谢

推荐答案

如果您的Sharepoint在线与Azure AD连接,则您可以使用Azure AD应用程序访问共享点REST API启用CORS。按照 https://msdn.microsoft.com/en-us/office/office365/howto/create-web-apps-using-CORS-to-access-files-in-Office-365 < a>

If your Sharepoint online is connected with Azure AD, then you can use Azure AD application access sharepoint REST API with CORS enabled. Follow the steps at https://msdn.microsoft.com/en-us/office/office365/howto/create-web-apps-using-CORS-to-access-files-in-Office-365

这篇关于从各种客户端在线访问共享点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆