Inside this function I make an ajax call to retrieve list items from the same list.
I get "Attempted to perform an unauthorized operation" when calling the REST-Api of SharePoint-Online by ajax.
I am accessing the Form with a high privileged user.
So I assume that this has to do with API permissions for SharePoint Online in Azure AD regarding Nintex Forms for Office 365?
Best answer by LevyView original
Found the answer myself. I totally missed that I am in an Add-In and did not used the RequestExecutor.
Credits to patrickabel. He helped with the following post: Solved: REST access denied from nintex forms office 365 - Nintex Community