简体   繁体   English

我们如何为 ajax 调用传递 @odataid 以调用将所有者添加到组的 post 方法?

[英]How can we pass @odataid for an ajax call to call a post method that adds an owner to group?

Can anyone please help me with how we can make ajax call the method to add Owner to O365 group.任何人都可以帮助我如何使 ajax 调用将所有者添加到 O365 组的方法。 I am using below mentioned end-point: https://graph.microsoft.com/v1.0/groups/{id}/owners/$ref我正在使用下面提到的端点: https://graph.microsoft.com/v1.0/groups/{id}/owners/$ref

This is how my ajax call is looking like as i'm thinking the user information will be pass through data property.这就是我的 ajax 调用的样子,因为我认为用户信息将通过数据属性传递。 Just want to know if this is the right way to work with this API只是想知道这是否是使用此 API 的正确方法

$.ajax({  
        method: 'POST',  
        url: "https://graph.microsoft.com/v1.0/groups/"+ OGroupID +"/owners/$ref", //pass 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) {});

I think this feature for passing @Odataid using Ajax call is currently not available, if you want this feature to be there, you can raise a feature request - https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform .我认为使用 Ajax 调用传递 @Odataid 的功能目前不可用,如果您希望此功能存在,您可以提出功能请求 - https://techcommunity.microsoft.com/t5/microsoft-365-developer-平台/idb-p/Microsoft365DeveloperPlatform

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM