I am using Office 365 and nintex forms and trying to get list item attachments in task forms. As the attachments doesn't come by default i am using javascript ajax call to get the attachment url but the ajax call is throwing Forbidden error.
In the developer tool i observed the error as -- required Cross Origin Resource Sharing (CORS). Here is my ajax call code. This code worked fine when i called in script editor web part.
NWF$.ajax({
url: requestUri,
type: "GET",
dataType : "json",
crossDomain: true,
xhrFields: { withCredentials: true
},
headers: {
"accept":"application/json; odata=verbose"
},
success: onSuccess,
error: onError
});
Please Let me know how can i resolve the issue.