我有一个日历插件(Office 365),我可以通过以下方式从项目中获取与会者:
item.requiredAttendees.getAsync() -> 价值和状态
在哪里
value =
{ "displayName": "List_1", "recipientType": "distributionList" },
{ "emailAddress": "email1@email.com", "displayName": "email1@email.com", "recipientType": "other" }
但是如何从联系人列表中获取地址?
没有 Microsoft Graph 是否可行?我没有可在以下请求中使用的tenantId:
https://login.microsoftonline.com/[TENANT_ID]/oauth2/v2.0/token
获取令牌,然后获取用户(或组)
******* 从这里编辑 *****
我不确定是否可以使用 Rest API 获取 Outlook 联系人列表中包含的电子邮件
我找到了一种从 Outlook 插件 https://docs.microsoft.com/en-us/office/dev/add-ins/outlook/use-rest-api使用此 API 的方法
我的代码:
Office.context.mailbox.getCallbackTokenAsync({isRest: true}, function(result){
if (result.status === "succeeded") {
var accessToken = result.value;
var restHost = Office.context.mailbox.restUrl;
var restId = Office.context.mailbox.convertToRestId(
Office.context.mailbox.item.itemId,
Office.MailboxEnums.RestVersion.v2_0
);
// Use the access token
(1)
}
});
(1) 为了测试值,我向 URL restHost + '/v2.0/me/messages/' + restId 发送了一个 GET;在“授权”标头(承载令牌)中带有 accessToken
But I receive:
{
"error": {
"code": "ErrorItemNotFound",
"message": "The specified object was not found in the store."
}
}
我究竟做错了什么?
一旦我可以使用这个 API,我就没有找到如何从联系人列表中获取电子邮件
提前致谢,
迭戈