
Hi @developer sp1 ,
Please do a Post Request to /_api/contextinfo to get SharePoint form digest token for authentication:
$.ajax
({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/contextinfo",
type: "POST",
async: false,
headers: { "accept": "application/json;odata=verbose" },
success: function(data){
var FormDigestValue = data.d.GetContextWebInformation.FormDigestValue;
console.log(FormDigestValue);
},
error: function (xhr, status, error)
{
console.log("Failed");
}
});
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.