Вопрос

I am trying to do the following:

I have a Wordpress site where I have created a form. On submit event I want to send the data to my Sharepoint Online list. The problem I am facing is the fact that the solution needs to be build entirely with JavaScript and/or jQuery.

I have seen multiple examples of people doing it but all of them somehow are having client context or _spPageContextInfo available. That is not the case with me.

My question is: Is there a way just send the data to the list using simple POST request?

Это было полезно?

Решение

OutSide of SharePoint Online Site, it's necessary to get the access token for authentication purpose.

A solution is to register a SharePoint App and get the access token with this request:

enter image description here

enter image description here

Then use the access token in the request to handle data:

enter image description here

Here is a detailed blog for reference:

Accessing SharePoint Data using Postman (SharePoint REST API)

Postman is a test purpose, you can convert the request above into Jquery ajax for coding.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top