Seeking assistance on how to utilize ajax for adding an Owner to an O365 group. Utilizing the following endpoint: https://graph.microsoft.com/v1.0/groups/{id}/owners/$ref
This is my current ajax call setup, where I am passing user information through the data property. Is this the correct method for interacting with this API?
$.ajax({
method: 'POST',
url: "https://graph.microsoft.com/v1.0/groups/" + OGroupID + "/owners/$ref", //Provide Office 365 Group Id
headers: {
'Authorization': 'Bearer ' + token,
'Content-Type': 'application/json'
},
data:{
"@odata.id": "https://graph.microsoft.com/v1.0/users/" + delegateOwner
},
}).success(function(response) {
console.log(response.value);
var data = response.value;
}).error(function(error) {});