Building custom solutions that extend, automate, and integrate Microsoft 365 apps.
Create custom Outlook event parameters
Antonio Letizia
0
Reputation points
Hi,
I contact you because, I’m developing a webpart with React on sharepoint, where I need to send custom parameters to a specific event in Outlook.Here is my function
const changeTypeEvents = async (data: any) => {
const customData = {
property1: "Value 1",
property2: "Value 2",
property3: 42,
};
const extensionName = "Com.Contoso.TypeMeetings";
const extensionValue = {
companyName: "Your Company",
expirationDate: "2023-12-31T23:59:59Z",
customProperty: customData,
};
const updateEventUrl = `https://graph.microsoft.com/v1.0/me/events/${data.id}/extensions`;
try {
const response = await fetch(updateEventUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${accessToken}`,
},
body: JSON.stringify({
"@odata.type": "microsoft.graph.openTypeExtension",
"extensionName": extensionName,
...extensionValue,
}),
});
if (response.ok) {
console.log('ok');
} else {
console.error('error');
}
} catch (error) {
console.error('error API: ', error);
}
};
Here is the error:
body: (…)
-
bodyUsed: false -
headers: Headers {} -
ok: false -
redirected: false -
status: 500 -
statusText: "Internal Server Error"
type: "cors"
We also tried to create an extension but it has always been a mistake. You can give us some information about it. Thank you!
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Development | Other
Outlook | Windows | Classic Outlook for Windows | For business
Outlook | Windows | Classic Outlook for Windows | For business
Using classic Outlook for Windows in business environments
Developer technologies | .NET | Other
Developer technologies | .NET | Other
Microsoft Technologies based on the .NET software framework. Miscellaneous topics that do not fit into specific categories.
Sign in to answer