I'm in the midst of developping an add-in to book appointments
I was trying to implement a functionnality that allows for user to set the recurrence through the add-in.
I am using Outlook on premise and am capped to the Mailbox API 1.5 and am getting this error when trying to getAsync() the recurrence item :
result: Object { value: undefined, status: "failed", error: {…} } error: Object { name: "Une erreur relative à l'hôte s'est produite", message: "Operation is not supported.", code: 5000 } status: "failed" value: undefined
Is there a way to still access this data through the add-in and to set it or should I drop this functionnality and let the user set the recurrence without the add-in ?
Recurrence support was added in Mailbox requirement set 1.7 per Outlook add-in API requirement set 1.7 and Get and set recurrence. It should work for users whose combination of client and platform version supports requirement set 1.7.
You could set the minimum requirement version to 1.7 in the VersionOverrides element of the manifest, so that supported users could use the recurrence functionality via the add-in, and users who don't support this set will not have the add-in appear in their Outlook client. See Specify Office applications and API requirements and Outlook add-in manifests for further guidance.
Related
We have a client that requires that an action take place when sending emails with certain Microsoft Information Protection/Azure Information Protection (MSIP/AIP) labels. We have a desktop Outlook add-in that does this perfectly.
Now however the client is requesting this same add-in but using the new modern style Outlook add-ins. We have created an on-send add-in to accomplish this, but we cannot get access to any internet headers in an Office.ComposeMessage. In fact, we cannot get any headers to be returned.
Here is our code:
async function fetchInternetHeaders(mailItem: Office.MessageCompose,
tags: string[]): Promise<string[]> {
return new Promise(function(resolve, reject) {
try {
let myTags: string[] = [
"msip_labels", // This is the value we need
"x-ms-has-attach", // This is for testing
"PR_SUBJECT_W", // This is for testing
"http://schemas.microsoft.com/mapi/proptag/0x0037001F", // test
"http://schemas.microsoft.com/mapi/proptag/0x5D07001F", // test
"http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/msip_labels/0x0000001F", // Another way to get msip_labels
];
mailItem.internetHeaders.getAsync(myTags, function(asyncResult) {
if (asyncResult.status === Office.AsyncResultStatus.Succeeded) {
debug.Log("onSend.fetchInternetHeaders", "Selected headers: " + JSON.stringify(asyncResult.value));
} else {
debug.Log(
"onSend.fetchInternetHeaders",
"Error getting selected headers: " + JSON.stringify(asyncResult.error)
);
}
resolve(["FetchedInternetHeaders"]);
});
} catch (error) {
debug.Log("onSend.fetchInternetHeaders", "Error occurred", error);
reject(error);
}
});
Note: We ignored the parameter "tags" to make everything as simple as possible.
The call succeeds but the returned array is always empty, even for simple properties like the email Subject. What are we doing wrong?
Both COM add-ins and Web add-ins don't provide any internet headers until the message is sent out. You may expect the internet headers set when the message is put to the Sent Items folder, but before that they are not created and stamped by the service/transport provider.
Most probably you need to access user properties, see the UserProperties object in the Outlook object model. But the Office JavaScript API (OfficeJS) doesn't provide anything for that out of the box, you need to use EWS or Graph API to access such properties from web add-ins.
You can specify data specific to an item in the user's mailbox using the CustomProperties object. For example, your mail add-in could categorize certain messages and note the category using a custom property messageCategory. Or, if your mail add-in creates appointments from meeting suggestions in a message, you can use a custom property to track each of these appointments. This ensures that if the user opens the message again, your mail add-in doesn't offer to create the appointment a second time.
Be aware, changes to custom properties are stored on in-memory copies of the properties for the current Outlook session. To make sure these custom properties will be available in the next session, use CustomProperties.saveAsync.
These add-in-specific, item-specific custom properties can only be accessed by using the CustomProperties object. Like I wrote earlier, these properties are different from the custom, MAPI-based UserProperties in the Outlook object model, and extended properties in Exchange Web Services (EWS). You cannot directly access CustomProperties by using the Outlook object model, EWS, or REST. To learn how to access CustomProperties using EWS or REST, see the section Get custom properties using EWS or REST.
You can post or vote for an existing feature request on Tech Community where they are considered when the Office dev team go through the planning process. Use the github label: Type: product feature request at https://aka.ms/M365dev-suggestions .
We have an Outlook (Office JS) Add-in with a manifest configured to support shared folders, i.e.
<SupportsSharedFolders>true</SupportsSharedFolders>
The add-in has been running flawlessly, for many months, on a number of machines that meet the minimum requirement set of 1.8 for shared folder support. Since 22-Apr-2020 it has returned the following error when selecting an email in a shared email inbox:
Status Code: 404
ErrorInvalidMailboxItemId - Item Id doesn't belong to the current mailbox
The REST API call that returns this error is:
https://outlook.office.com/api/v2.0/me/messages/<RestID>/
Where <RestID> is created from: Office.context.mailbox.convertToRestId(Office.context.mailbox.item.itemId, Office.MailboxEnums.RestVersion.v2_0)
Has an API change been documented anywhere?
Do we need to modify our code?
This is not a recent change. The REST URL should be constructed based on the SharedProperties descrbied here https://learn.microsoft.com/en-us/javascript/api/outlook/office.sharedproperties?view=outlook-js-1.8 Note that the SharedProperties API is only available for shared items.
We have an Outlook Module Manifest that worked two weeks ago against Office 365 (never against Exchange 2013).
When we tried to remove it and add it again today, we got the following error message:
Value cannot be null. Parameter name: recipient
We then tried to add the Outlook Module Manifest sample from here, but that throws the same error message.
Any idea what we may be missing? Or did Microsoft change their Office 365 infrastructure, breaking their own sample?
This error message may just want to tell you that your account does not have an Exchange Online license assigned right now. The account used to upload an extension for the organization requires a valid Exchange Online license.
I am trying to set the reminder of a calendar event to None by code using Microsoft Office 365 API
I am passing -1 value to Microsoft.Office365.OutlookServices.Portable.dll, v1.0.41.0 (using the updated DLL's) Event class reminder property and creating the event
The event is causing issue in Outlook as I am passing -1 to nullable integer type reminder and it is taking it as -1 minutes to the value of reminder. OKAY. Makes sense.
But it is not allowing me to create an event with null as reminder and taking 15 minutes as default value to reminder.
Moreover it is not updating the reminder value of any event to null but when I set any reminder to none in Office 365 then trying to fetch the event, it is fetching the value as null.
And when I am setting -1, it is OK in Office 365 web portal but creating issues in Outlook synced events on Desktop
Please suggest what value of reminder should I pass or how can I create an event with None as Reminder in Office 365.
Please let me know if I missed anything or if any other info is required.
You need to set the IsReminderOn property to false to turn off the reminder. This property is available in the v2.0 and beta endpoints of the API. This should be available in the Microsoft.Office365.OutlookServices-V2.0 nuget package.
https://msdn.microsoft.com/office/office365/api/complex-types-for-mail-contacts-calendar#RESTAPIResourcesEvent
From this release notes document ,Currently you can't set a reminder from the client library or directly via REST when you're creating or updating events. The event reminder field is not updated, but no error is returned. For example , i set the Reminder property of event as 1 :
After adding this event to calendar successfully, you could use fiddler to grap the post request , you will find no Reminder information will post to the api endpoint :
Also if you not set the Reminder property,it will be set as null ,and will also add the event successfully.When checking that event in O365, the reminder will be 15 minutes .
I am new with the "outlook" api. i want to get all calender event,contact and mail from "outlook account".
but i does not get appropriate result with "outlook" account its working fine with "office365" account
i follow this documentation for get all required data
and i create application for getting data from here
but every time when i login with my outlook account it's give me an error like this.
Please help me out.
Thanks in advance...
Just ran into the same problem and found an explanation here. It appears we're going to have to wait for the accounts to be enabled unless you request a testing account as described in the link. Confirmed the same results when using the non-enabled account in the Outlook Oauth Sandbox.
From the first link
Because enabling mailboxes on Outlook.com for the Outlook REST API happens over a period of time, your existing Outlook.com account may take a while to get enabled. To test your app accessing data on Outlook.com mailboxes that have already been enabled, you can request a new, enabled Outlook.com developer preview account by emailing outlookdev#microsoft.com.
If your app accesses Outlook.com mailbox data, it should handle scenarios where the user's mailbox has not yet been enabled for the Outlook REST API. In such situations, when you make a REST request, you would get an error like the following:
HTTP error: 404
Error code: MailboxNotEnabledForRESTAPI or MailboxNotSupportedForRESTAPI
Error message: “REST API is not yet supported for this mailbox.
Step 1 :
Click the Below Link :
https://oauthplay.azurewebsites.net/?code=M657b8bab-e543-f849-134c-0a2f85179a67&state=17661047-2a14-4c90-9edd-0119f841b559
Step 2:
Step 3 :
Step 4 :
Step 5 :