How to access Sharepoint REST API in my function app
GBS-SharePoint-Admin
1
Reputation point
My function app is triggered via an external webhook, whenever it is triggerd i want to update data in a list in my sharepoint site, I tried following the steps here (https://www.c-sharpcorner.com/blogs/setting-for-sharepoint-online-to-accessible-from-external-environment) but i'm getting 404 error as a response everytime, is there any other way to access sharepoint rest api from my azure function? Please Help
My code snippet from my node.js function that i tried for authentication (I've hidden the sensitive credentials with star)
const formData = new FormData();
formData.append('grant_type', 'client_credentials');
formData.append('client_id', '***@****');
formData.append('client_secret', '*****');
formData.append('resource', '00000003-0000-0ff1-ce00-000000000000/***@****);
const res = await axios.post('https://accounts.accesscontrol.windows.net/******/tokens/OAuth/2', formData, {
headers: {
'Content-Type':'application/x-www-form-urlencoded'
}
});
Sign in to answer