Outlook Addin Documentation: Format of Location and EmailUser - outlook

I'm trying to sync values of location and attendees between Outlook Web event creation screen and my outlook Addin. In documentation, as shown in screenshot attached below, type of location is given as String|Location.
I clicked on the link of Location and didn't find a description of type Location anywhere. In the documentation, Location is used as string, but the problem arise when I try to set a location from my addin to Location field of Outlook event screen. When I checked the value, I got it as shown below
I'm setting the value of location as
Office.context.mailbox.item.location.setAsync(emailAddress_to_add);
Same is the case for EmailUser in case of Recipients/Attendees.
Can anyone tell me the correct format, i.e. Location and EmailUser in which I should set the location and attendees?

If your location is just a string (not associated with an email address), you can use location APIs
Office.context.mailbox.item.location
In read mode, location is just a string property on Office.context.mailbox.item.
In compose mode, location returns an object of type Location, on this object you can perform get/set operation.
If you want to set a location which has an associated email address, then you can make use of EnhancedLocation preview API.
Office.context.mailbox.item.enhancedLocation
In read and compose mode, enhancedlocation will return an object of type EnhancedLocation, on which you can perform add/get/remove operation.
var locations = [
{
"id": "ConfRoom101#contoso.com",
"type": Office.MailboxEnums.LocationType.Room
}
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations);

Related

How to get PidTag properties from Exchange via Graph API

I want to read PidTag properties from a specific e-mail message via Graph API REST call.
For singleValueExtendedProperties that is no problem as each of them has a specific GUID and in the filter query parameter can easily search for id with the corresponding property.
However I can't do the same with PidTags (i.e. the PidTag PidTagAccess or as OutlookSpy would show it: PR_ACCESS) because all of those PidTags have only the following attributes:
Tag num: HEX
Tag sym: String
Type: PropertyType
Value: Int
Does anyone have an idea how I could get those PidTags from an Outlook message?
I tried to put different types of attributenames into the filter query that weren't listed in the api and didn't really expect it to work. But it's better to try something out rather than to assume it won't work.
Use the proptag format to access properties predefined by MAPI, or by a client or server, and that have not already been exposed in Microsoft Graph. These properties have property identifiers in the 0x0001-0x7fff range. You can find more information about that in the Outlook extended properties overview.
Each predefined property in MAPI has well-defined description in MSDN with a property type, description and its identifier. For example, take a look at the PidTagAccess property description where you can get the required information. In OutlookSpy you may find the same information I believe.
Identifier for PidTagAccess is 0x0FF4 and type is integer, so valid id format for singleValueExtendedProperties is '{type} {proptag}'
Query to read the property:
https://graph.microsoft.com/v1.0/me/messages/{message_id}?$expand=singleValueExtendedProperties($filter=id eq 'Integer 0x0FF4')
Since you are already using OutlookSpy (I am its author), you can build your Graph queries with any MAPI properties in OutlookSpy: click Message button in the Graph group on the OutlookSpy ribbon, click "Query Parameters", check "$expand" checkbox and click the button to the right of the edit box.
In your particular case (PR_ACCESS MAPI property), the query will be singleValueExtendedProperties($filter=id eq 'Integer 0x0FF4')

How to search Zoho custom module using API v2?

I am using an access token with ZohoCRM.modules.custom.READ.
When I send a GET request to https://www.zohoapis.com/crm/v2/Custom/search, I get the following error.
{
"code": "INVALID_MODULE",
"details": {},
"message": "the module name given seems to be invalid",
"status": "error"
}
What am I doing wrong and how do I define the module I am trying to pull data from (it is called CustomModule2)?
Figured it out...
First, needed to go to https://crm.zoho.com/crm/{org_id}/settings/modules to find the actual name of CustomModule2 which is Adresses livraison.
Then, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules to find the API name for Adresses livraison which is Adresses_livraison.
Finally, needed to go to https://crm.zoho.com/crm/{org_id}/settings/api/modules/CustomModule2?step=FieldsList to find the API name of the field I wanted to use as a search criteria (it was Compte].
The final query using httpie is as follows.
http GET https://www.zohoapis.com/crm/v2/Adresses_livraison/search \
Authorization:"Zoho-oauthtoken {access_token}" \
criteria=="(Compte:equals:{account_id})"
Zoho is up there in the most awkward developer experiences I have encountered.
Just an update for anyone still looking into this, because I noticed that the links aren't always the same, depending on whether it's a sandbox or not, etc. So the steps are:
Go to your CRM page/dashboard and click on the Settings (cogwheel icon) on the top-right, next to your account image.
A bunch of items in panel boxes open. In the panel named "Developer Space" choose APIs
There it opens a bunch of tabs and sub-tabs and a Dashboard (As shown on the image below). The "Dashboard" sub-tab should be selected, all you have to do is switch to the sub-tab "API-Names"

How to set multiple locations in Outlook compose form?

I am currently working on an Angular outlook addin using Microsoft Graph API. I have to set and get Outlook item data in compose form. I referred the link Get and set data items in outlook compse form for doing that. In the case of location, I used
Office.context.mailbox.item.location.setAsync('LocationA');
But it will take only string. In the case of multiple locations, I cant use this property. Is there any other way to implement the setting of multiple location in Outlook compose form?
You can use EnhancedLocation Preview API to set one or more locations that are associated with email ids. You need to use addAsync and passing the locations to be added to the current list of locations as locationIdentifiers.
Office.context.mailbox.item.enhancedLocation
In read and compose mode, enhancedlocation will return an object of type EnhancedLocation, on which you can perform add/get/remove operation.
var locations = [
{
"id": "ConfRoom101#contoso.com",
"type": Office.MailboxEnums.LocationType.Room
}
];
Office.context.mailbox.item.enhancedLocation.addAsync(locations);
Also be aware that this API is provided as a preview for developers and may change based on the feedback. It is wise not use this API in a production environment.

Return Places nearbysearch with only 'my' locations loaded to 'Bulk Uload Tool' against my API/ID

GOAL:
I am working to return a result set of locations via the types=other parameter so that I can ensure ONLY MY locations are part of the result set.
Question/Scenario 1:
I am able to submit place/add for a location and retrieve that location with nearbysearch, however I am not able to add all my data via this method such as hours, image, url, etc. Is there formatting to support this data upload in the place/add?
Question/Scenario 2:
I have uploaded my locations in the 'Bulk Upload Tool' under my ID that is associated to my API key. In the upload I included the category 'Other'. None of these locations return in my nearbysearch result set. Should they return? If so, does anyone have insight to how?

Outlook Add-In : Get Contact from Mail

I am doing a bit add-in development for outlook 2010 and I'm trying to get the ContactItems associated to an email (MailItem). I think the MailItem.Links collection should return what I want, but it's empty. Maybe I'm on the wrong path, but I'm out of ideas at the moment.
I have an Outlook.MailItem and I like to get the associated Outlook.ContactItem. When you open a mail with outlook and hover over the mail-adresses a contact-popup appears, so the link must be somewhere in the MailItem, but I don't know where.
For example, I tried using the MailItem.Links collection which says in tooltip that it represents the contacts to which the item is linked.
Explorer explorer = application.ActiveWindow() as Explorer;
MailItem mail = explorer.Selection as MailItem;
foreach (Link l in mail.Links)
{
System.Diagnostics.Debug.WriteLine("Link: " + l.Name);
}
The MailItem so far is correct, I can do whatever I want with it but
the MailItem.Links collection is empty.
You should try using the MailItem.Recipients collection which contains the addresses where the message will or has been be sent to (i.e. To, CC, BCC). You will have to check the Recipient.AddressEntry to see if the address exists in the Contacts Address Book (CAB) via GetContact, otherwise you will have to resolve it using ExchangeUser via GetExchangeUser.
The AddressEntry.AddressEntryUserType will tell you what type of recipient is included in the message - Exchange User or List, CAB, or basic SMTP address.

Resources