How to use Sharepoint Online REST API via local HTML

Asked

Viewed 195 times

2

Good afternoon,

I would like to know how to use the Sharepoint Online REST API through external applications, specifically a local HTML with JS.

Using the example of this article https://pholpar.wordpress.com/2013/05/11/accessing-office-365-sharepoint-sites-using-rest-from-a-local-html-javascript-host, receive the following error msg:

Xmlhttprequest cannot load https://login.microsoftonline.com/extSTS.srf. Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'null' is therefore not allowed access.

Thank you.

1 answer

1

You will be able to perform Sharepoint Online queries in this way using Microsoft Graph.

You can choose the platform you will develop with the Graph Api.

Escolha da Plataforma

Generate an App ID

inserir a descrição da imagem aqui

And then use one of the codes available to the community on Github

inserir a descrição da imagem aqui

Follows: Website Microsoft Graph Examples: Examples Consultation

  • I changed including a step by step to start using the Microsoft Graph Api. :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.