Availability of sharepoint online from different customers

I have an online sharepoint site, I use ads. These are the ads that I would like to use in the Cordova application, as well as on the HTML5 website, which I have on some information screens.

I studied using the REST service and applications for sharepoint.

Example:

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); } }); 

When I run this, I get: The requested resource does not have an Access-Control-Allow-Origin header. Therefore, the original "null" is not allowed.

I know that I can try to enable CORS on sharepoint or use JSONP.

I was wondering if the path I'm currently following is the right path, or would it be better to create my own WebService and get the data through this?

Any better ways?

thanks

0
source share
1 answer

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

0
source

All Articles