Microsoft Graph Unified Contacts List - microsoft-graph-api

Is it possible to create Exchange contacts list which will be shared across the whole organisation using Graph API?
These contacts are not the part of the organisation.
I know we can add contact to user's contact list, however was not able to find a way to have a contact which will be shared across the whole organisation.
POST /me/contacts
POST /users/{id | userPrincipalName}/contacts
POST /me/contactFolders/{contactFolderId}/contacts
POST /users/{id | userPrincipalName}/contactFolders/{contactFolderId}/contacts
I am aware that contacts are shared if the contact is within organisation and if they are in Active Directory Domain Services (AD DS). However these contacts are outside of the org.

Mail Enabled directory contacts (which are stored in AD) are available using the organizational contacts endpoint https://learn.microsoft.com/en-us/graph/api/orgcontact-list?view=graph-rest-1.0&tabs=http. However they don't allow you to create Org contacts in the Graph there's a uservoice request for this https://microsoftgraph.uservoice.com/forums/920506-microsoft-graph-feature-requests/suggestions/38083912-make-it-possible-to-create-organizational-contacts (but not looking good at getting this changed)
So the Exchange cmldets are still the only real way of doing this programatically https://learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2?view=exchange-ps
eg
New-MailContact -Name "Chris Ashton" -ExternalEmailAddress "chris#tailspintoys.com"

While this does not answer my question directly, one of the solutions would be to have a user which will serve as a master containing all contacts.
This way contacts list would be accessible using following Graph call
GET /users/{id | userPrincipalName}/contacts
The downside of this approach is that whenever new contact is added to personal list it would need to be added to this list as well.

Related

Query to pulled data using Microsoft graph

I never use Microsoft graph. I just want to query to just pull a selection of users by supervisor using Microsoft graph
Run https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}/directReports
See reference
Create SPFx to call graph api to get users.
the demo had shared how to search/filter users, to get all users, just remove the filter logic.
https://graph.microsoft.com/v1.0/users?$select=displayName,mail,userPrincipalName
This should work, if you want to get specific user with given email ID. Just change your email ID. The email ID I have given is just an example.
https://graph.microsoft.com/v1.0/users/xyz#mail.com?$select=displayName

Get list of Google Business Reviews for any business?

Can I get a list of reviews from an arbitrary business?
It appears like you get a list of the reviews for a specific account and location.
https://mybusiness.googleapis.com/v3/accounts/account_name/locations/location_name/reviews
However, you can only get a list of account for an authenticated user.
https://mybusiness.googleapis.com/v3/accounts
Is there an endpoint or way to list out the reviews for any business? I just need the number or reviews, and really don't want to have to look at screen scraping type solutions.
The Places API returns only 5 for a business, GMB API requires the user as you’ve mentioned to authenticate; there’s no official endpoint for getting all listed reviews unless you either scrape the data; like Yelp, Google didn’t make it available to pull all user contributed content such as reviews; alternatively you can create your own DB for some businesses and manually update by pulling reviews off a third party site (eg: ReviewsMaker.com) where you can copy data to a table and keep track, but there’s no other real-time solution other than using the GMB API (which is restricted only to authenticated users)

Microsoft Graph API - /me/people does not return desired result

I'm working on a project using Microsoft Graph API. This project uses /me/people to get data.
According to Microsoft: "Microsoft Graph applications can use the People API to retrieve the people who are most relevant to a user. Relevance is determined by the user’s communication and collaboration patterns and business relationships. People can be local contacts, contacts from social networking or from an organization’s directory, and people from recent communications (such as email and Skype)."
According to this, I think that the result can be confirmable.
For example, I have 3 users account: user1#tnv.onmicrosoft.com, user2#tnv.onmicrosoft.com, user3#tnv.onmicrosoft.com. I put them in the same AAD security group named AADTestGroup.
I expect that when user1 calls /me/people, the result contains user2 and user3. However, it does not returns as expected.
The questions are:
What am I missing here?
How could I organize user accounts in O365 to get confirmable result from /me/people?
How long does this function take to reflect changes from Office 365?
Being in the same security group isn't a relevant "communication and collaboration pattern" or "business relationship". Until you have sufficient activity between these users, they will not show up in the result. Try editing the same document, emailing each other, etc. and they will begin to show up.

Microsoft Graph API: admin can't list other users people

Logged in as the Office 365 Global Administrator, I want to get the relevant people list for any user in Active Directory.
I can get my calls to return using
https://graph.microsoft.com:443/v1.0/users('my.address#contoso.com')/people
and
https://graph.microsoft.com:443/v1.0/users/{the user id}/people
and
https://graph.microsoft.com:443/v1.0/users('{the user id}')/people
and
https://graph.microsoft.com:443/v1.0/users/my.address#contoso.com/people
but, as an Office 365 admin with People.Read.All consent in the app, the call only returns one person (the target user's profile) for any user but myself. If I call it for my user I get a list of ten people
If I log in as that other person and make the People List API call it returns the expected ten results.
JWT scope: "scp": "Files.ReadWrite Mail.Send People.Read.All User.Read
I have to change the scope to People.Read for the non-admin.
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_people
the call only returns one person (the target user's profile) for any
user but myself.
Answer is in the API Doc. As the document says.
Retrieve a collection of person objects ordered by their relevance to
the user, which is determined by the user's communication and
collaboration patterns and business relationships.
The following request gets the people most relevant to another person in the signed-in user's organization
https://graph.microsoft.com:443/v1.0/users('my.address#contoso.com')/people
It might happen that there is no one relevant to that user.
If you want the list of contacts in other user's contact list then you can refer to this one :
https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/user_list_contacts
UPDATE
https://developer.microsoft.com/en-us/graph/graph-explorer
I used the demo account on this website. I used this query
https://graph.microsoft.com/v1.0/users/08fa38e4-cbfa-4488-94ed-c834da6539df/people It worked.
This query gives the same result
https://graph.microsoft.com/v1.0/users('08fa38e4-cbfa-4488-94ed-c834da6539df')/people
Same result
https://graph.microsoft.com/v1.0/users('MiriamG#M365x214355.onmicrosoft.com')/people/
Same result
https://graph.microsoft.com/v1.0/users/MiriamG#M365x214355.onmicrosoft.com/people/
If you still can't get it to work and specially on Graph Explorer Website. Then it means that according to Microsoft there are no relevant people for that particular user.
As you can see there are different ways to use the same thing. Try it all if it works. Let me know.
I am not seeing this behavior in the Graph Explorer sample tenant. The behavior seems to indicate that this is auth-related. I would try to sign in with the admin again and make sure that you've consented to any of the admin-only scopes. Additionally, one thing you can do to figure out whether you have the appropriate scope in your token is decoding the JWT and examining the "scp" collection.

Is it possible to programmatically retrieve the Sharepoint contact lists that a user has added to their outlook?

I have a custom addressbook built into a c#.net app. My users have gone into Sharepoint and have connected/linked the contact list there into their outlook. They would like for these Sharepoint Contact lists to show up in our custom addressbook app, but I can't find a way to access that particular data.
I was hoping that there would be some LDAP path or EWS call that I could make to get these Sharepoint contact lists.
I've thought about looking at sharepoint directly via the API to get the contact list data, but I still wouldn't know if they have actually added those lists to their outlook or not.
The configuration of a SharePoint connection is stored in the folder asssociated items table of the inbox folder. See http://www.infinitec.de/post/2011/07/13/Enumerating-Sharepoint-Connections-in-a-mailbox-with-EWS.aspx for a sample on how to enumerate them.

Resources