Domanda

I've followed the steps from the following answer: sharepoint 2013 anonymous 401 UNAUTHORIZED1

However, it works partially for me. The REST calls works when I try to access basic information from any list, but when I call 'FieldsValuesAsHtml' endpoint, the response is 401 Unauthorized.

enter image description here

È stato utile?

Soluzione 2

Finally, I was able to solve the problem. In order to 'FieldValuesAsHtml' endpoints get to work with both Anonymous and registered users, you have to make the request with POST method and empty body passing the header X-RequestDigest and it's value.

I was able to get the header value from this endpoint: /_api/contextinfo. Just be sure to call this before every 'FieldValuesAsHtml' requests.

Altri suggerimenti

Check whether the following REST API works or not.

/_api/web/lists/getbytitle('listname')/items(28)

And then check the REST API below.

/_api/web/lists/getbytitle('listname')/items(28)?$expand=FieldValuesAsHtml
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a sharepoint.stackexchange
scroll top