Global Address List Graph API - microsoft-graph-api

I am trying to use the Graph API inside an Office 365 add-in to get contact information out of GAL. Neither of the following queries return any contacts from the GAL, although both return some information.
beta/me/contacts?$filter=displayName eq 'John Smith'
beta/me/people?$filter=displayName eq 'John Smith'
Is it possible to get contacts from the GAL using the Graph API? I having a feeling I am not giving my app the correct permission to access the GAL.

The /me/contacts endpoint returns the contacts from your default Outlook Contacts folder. The /me/people endpoint is similar but attempts to pull information on contacts access multiple sources.
The GAL represents contact information from your organization (i.e. Active Directory). To see the contact information for other users in your organization, you use the /users endpoint. To see organizational contacts (contacts added to the AD/GAL) you need to use the /contacts endpoint (note the lack of /me/ in the path).

Related

Connect Microsoft Exchange to n8n

Hello my goal is to get exchange server data like:
email,firstname,lastname
and save in DB
For doing this i've read that i have to make this callback request:
https://graph.microsoft.com/v1.0/me/contacts
from microsoft graph and get the data in n8n workflow system
Hello my goal is to get exchange server data like: email,firstname,lastname
You need to clarify what data your after eg are you after a particular users personal contacts or are you after the whole organizations email details (eg similar to what you see in the Global Address List).
https://graph.microsoft.com/v1.0/me/contacts
This will give you the current users personal contacts but if your after the organizations information then you use https://graph.microsoft.com/v1.0/users or Org contacts you would use https://learn.microsoft.com/en-us/graph/api/orgcontact-list?view=graph-rest-1.0&tabs=http

How to get the externally shared user's profile information for one drive using Microsoft Graph api

To get External user information if we share the file with specific people through link.
You can use following end point for fetching external users in your AD:
https://graph.microsoft.com/beta/users?$filter=userType eq 'Guest'
make sure that you have to select beta version of microsoft graph for additional user properties.
If you just want to get the external user list, you can use "/users?$filter=userType eq 'Guest'" resolve your issue.
If you want to get the access log of share file through link:
No matter you use OneDrive or OneDrive for business, we cannot use Graph API to get the user who have access the share file through link.
If you share the Team site's document, we can use JSOM to get the user profile first and store it to the access log. Then use the get user api to get the external user info.
If you share the document from OneDrive/OneDrive for business, we cannot assign our custom access log and no known Graph API for this too. You can submit an feature request in the UserVoice, meanwhile, you can try to see the audit logging first.

Graph Explorer does not appear to support EDU endpoints

Currently, Graph Explorer does not appear to support EDU endpoints. Is there a way to work around this problem?
According to your descriptions, I presume you want to find whether there is a wat to support EDU endpoints or not.
Base on my test, we can use the API like this:
GET /education/schools
It will return a collection of educationSchool objects in the response body.
In this document, we can find that this API support the work or school account. If we use a personal microsoft account to login the Graph Explore, it will not support the EDU endpoints.
The default tenant (i.e. the tenant data you get when you haven't logged into Graph Explorer) does include Edu data.
If you are authenticating, you will only be able to call the Edu endpoints if you have consented to the Edu scopes and your tenant is an Office 365 Education instance. These endpoints will not work with a non-Edu O365 tenant.

Microsoft Graph API People API Failed to search in User Created Folders

https://graph.microsoft.com/v1.0/me/people/?$Search="contact1"
Result is empty if contact1 is under a user created folder - Folder1.
How can we search for COntacts from all Folders using a Single API call?
According to the questions and the comments you posted, I suppose you want to get the email-address of the people under a Contact Folder and get all contacts under the contacts folder.
For your case 1, according to the description of the content Use the People API in Microsoft Graph to get information about the people most relevant to you, we can get the people most relevant to the signed-in user (/me), or to a specific user in the signed-in user’s organization, instead of the people under a Contact Folder.
For your case 2, we use the API for getting the contacts, It will only return contacts under the default folder. Single contact file directories can only be obtained through this API. We can refer to the simple code in this content to get contacts in the contact folder.

Read co-workers planner tasks

Is it possible to retrieve a list of co-worker Planner tasks via the API?
For example the graph explorer provides the following GET endpoint:
https://graph.microsoft.com/v1.0/users/coworker-mail/planner/tasks
I can get results back using my own email address in url, but always a 403 failure when using a coworkers email.
I have Group.Read.All as a delegated permission on the app, I am an admin user and have granted consent via the admin consent endpoint to no avail.
Is this possible? If not what am i missing and why does the explorer/api expose that endpoint?
Thanks
Querying other users' data is currently not allowed. You can provide feedback about this behavior here.
The endpoint exists to support reading signed in user's data. "me" segment is simply an alias that in reality executes the request against /users/(signed in user id).

Resources