【发布时间】:2020-12-26 22:08:29
【问题描述】:
我一直在编写一个 node.js Java 脚本来查看 MSFT 图形信息。我正在尝试将所有者发布到可以使用网站上的 Https 帖子的组中。但是,当我尝试运行 Node Is 代码时出现错误。我似乎对这个对象有疑问:
const directoryObject = {
@odata.id: "https://graph.microsoft.com/v1.0/users/{id}"
};
JavaScript 似乎不喜欢对象键中的 @ 或 。
https://docs.microsoft.com/en-us/graph/api/group-post-owners?view=graph-rest-1.0&tabs=http
JavaScript 代码 sn-p :
常量选项 = { 身份验证提供者, };
const client = Client.init(options);
const directoryObject = {
@odata.id: "https://graph.microsoft.com/v1.0/users/{id}"
};
let res = await client.api('/groups/{id}/owners/$ref')
.post(directoryObject);
非常感谢
多米尼克
【问题讨论】:
标签: node.js microsoft-graph-sdks