gpt4 book ai didi

javascript - 我可以在 outlook javascript 的 MessageComposeCommandSurface 中获取休息 token 吗?

转载 作者:行者123 更新时间:2023-11-30 11:17:33 36 4
gpt4 key购买 nike

当我的扩展程序从 MessageReadCommandSurface ExtensionPoint 打开时,我可以获得一个 token 并请求用户联系人,但是如果我的 ExtensionPoint 更改为 MessageComposeCommandSurface 我对 getCallbackTokenAsync 的调用失败以下。

{
"name": "CanOnlyGetTokenForSavedItem",
"message": "The token can't be retrieved until the item is saved.",
"code": 9029
}

我的代码运行起来相当简单。

Office.initialize = 
() => Office.context.mailbox.getCallbackTokenAsync({ isRest: true },
res => console.log(res));

是否可以在消息撰写 Pane 中从我的加载项查询用户的联系人?

最佳答案

如错误提示,您可以 save the item并在保存项目后获取 token 。

Office.context.mailbox.item.saveAsync(
function callback(result) {
// Process the result
});

Office.context.mailbox.getCallbackTokenAsync() 预计会返回一个范围为该项目的 token 。(具有 ReadWriteMailbox 权限的加载项除外),因此预计该项目将被保存。

关于javascript - 我可以在 outlook javascript 的 MessageComposeCommandSurface 中获取休息 token 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51004240/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com