【发布时间】:2021-08-17 07:54:26
【问题描述】:
我想创建具有自定义值的 Outlook 日历事件。因为我需要在打开活动时获得一些价值。
这是否可以在 Outlook add in - 日历事件中创建事件时发送自定义值。
const msalConfig = {
auth: {
clientId: CLIENT_ID, // Client Id of the registered application
redirectUri: REDIRECT_URL,
},
};
const graphScopes = ["user.read", "mail.send", "openid", "profile"]; // An array of graph scopes
const msalApplication = new UserAgentApplication(msalConfig);
const options = new MSALAuthenticationProviderOptions(graphScopes);
const authProvider = new ImplicitMSALAuthenticationProvider(
msalApplication,
options
);
const option = {
authProvider, // An instance created from previous step
};
const client = Client.initWithMiddleware(option);
示例事件:
let event = {
"subject": "Let's go for lunch",
"body": {
"contentType": "HTML",
"content": "Does mid month work for you?"
},
"start": {
"dateTime": "2021-08-13T12:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2021-08-13T14:00:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Harry's Bar"
},
"attendees": [
{
"emailAddress": {
"address":"adelev@contoso.onmicrosoft.com",
"name": "Adele Vance"
},
"type": "required"
}
]
};
client.api("/me/events").post(event, (err, res) => {
this.setState({ isLoading: false });
});
我想在创建事件时传递自定义值。这是否可以使用自定义值创建事件。
【问题讨论】:
标签: outlook microsoft-graph-api outlook-web-addins outlook-calendar