Adding users to the Global Address List (GAL) through the Microsoft Graph API - azure

Most of the posts I've read online about this are about a year old, or don't answer my question specifically. I know through the graph API you can view contacts and users, and you can add contacts and users, but when I've viewed the contacts and users through the graph API, they don't match what's in my global address list exactly. So I believe that they're not the same thing.
Also, a lot of the posts I've read asking questions similar to this have said adding users to the Global Address List is not supported through the Graph API and must be done programmatically through powershell or something like that. These answers though were posted around a year and a half ago. So I'm wondering if this still isn't possible through the graph API.

So firstly I'd like to understand why you indicate that the Global Address List is different from what you can get back from Graph API. As far as I know these should be identical, so please indicate where you are seeing differences. Also Azure AD PowerShell v2 calls through Graph.
As for updating the global address list, this is mostly possible through Graph API. If you are trying to add new users to your directory, you can POST on http://graph.microsoft.com/v1.0/users. Please see https://graph.microsoft.io/en-us/docs/api-reference/v1.0/resources/users and https://graph.microsoft.io/en-us/docs/api-reference/v1.0/api/user_post_users. There are also PowerShell cmdlets for this. If you are trying to add organizational contacts, currently this is not supported through Graph API or through Azure AD PowerShell. Organizational contacts may be queried (currently only available in preview by doing GET https://graph.microsoft.com/beta/contacts), but adding org contact is only possible through creation in on-premises AD and synchronization though AD Connect OR via Exchange experiences (like Office portals or Exchange PowerShell).
Personal contacts may also be fetched and added through GET and POST https://graph.microsoft.com/v1.0/me/contacts respectively.
Hope this helps,

At present, it is not possible to add the users to Global Address List. We are only to add the person contacts to the root Contacts folder or to the contacts endpoint of another contact folder( refer here).
You can try to submit the feedback from here if you want the Microsoft Graph to support this feature.

Related

Group name as claim in Azure AD

I have an enterprise app used to send claims to an on-prem ADFS.
I need to send the group names my Guest users belong to. I know that OOTB you can only send the Gpoup ID.
As suggested in other posts I can use the Graph API to get the group name, but how can I then send this as claim?
Unfortunately, it's only possible to get the object ids as of right now. This may be implemented in the future, however, in order to get the group names you will need to have some sort of service that makes calls to the Microsoft graph utilizing the ID.
Please raise the UserVoice or vote for similar uservoice

docusign custom connector pricing plans and API base path doubts

I have some doubts regarding the custom connector we are trying to build for docusign : -
Regarding the license plan that need to be bought by the customers who will be granting access for our connector to collect data from their docusign organization account. I am looking at the link https://www.docusign.com/products-and-pricing. API access support is mentioned in only the advanced solution. So I was wondering whether only we need to have "Advanced solutions plan with APIs support" plan or all our customers need to API access support in order to fetch their data.
As per the documentation, to make the REST API calls we need two fields 'base_uri' and 'account_id' (https://developers.docusign.com/esign-rest-api/guides/authentication/user-info-endpoints). Now, the response of userInfo API call gives an array of accounts and its respective fields. My doubt is, if multiple authenticated users (more than one accounts) are returned in this array but all are part of same organization, will they all have different account_ids. Main concern here is, will there be several Base Paths (https://developers.docusign.com/esign-rest-api/guides/authentication/user-info-endpoints#form-your-base-path) to make API calls?
2a. Further question is, what is the significance of 'is_default' field?
Is this related to main account (if is_default is true) using which we will create our Base Path?
Since this is a tech/engineering forum I'm going to answer only question #2 as question #1 is more of a business/sales question.
The reason you may get multiple accounts is that an authenticated user in DocuSign can be a member of multiple accounts. That said, it's the same user. Meaning, say foobar#blah.com has an account 123 with company X and account 456 with his school, then it's possible that when foobar#blah.com authenticates (With the same password!) to DocuSign we have a list of accounts associated with that user. We give you all of them when you make the API call. The default one is the main one that you would see when you log into our web app. You can decide yourself as the user which one is the default. Users who log into our web-app then see an option at the top-right to change accounts.
and yes, every API call is associated with a specific account. So when you construct the urls for your API - you do need to know which account for this user you are making the API call for. Your application can decide how to handle this.
Hope this helps.

OneDrive REST API and Sharepoint Online

I have the app that uses OneDrive API (MS graph) to access OneDrive free accounts and OneDrive for business.
The app works fine.
In docs of the API i can see same API can be used also to access Sharepoint Online sites data.
How to do this? When i auth a user who has Sharepoint Online account with MS graph, there is only his drive (ondrive) but there is no his site listed.
How to get access to his sharepoint site too using same API?
I have found how to work with sites using the Graph API.
To get list of sites there is the call
GET /v1.0/sites/
Then use the SITEID to get list of drives (in fact, top level folders)
GET /v1.0/sites/SITEID/drives
Then to get contents of a drive user
GET /v1.0/sites/SITEID/drives/DRIVEID/root/children
And all next calls are same as for onedrive drive
However, there is the problem i still can not solve. How to create new top level folder (new drive on a site). There is no API call for this
I believe what you are looking for is the sites API. It lets you interact with a SharePoint site if you know the path or the id of the site. You can find the documentation for the api here:
https://dev.onedrive.com/resources/site.htm
There is no easy way to discover sites as of now. You can however search for a site. You can read more about it here:
https://dev.onedrive.com/sites/search.htm
This endpoint to get the list of sites is not working, so the last answer is not valid anymore.
https://graph.microsoft.com/v1.0/sites
I haven't found a way to do this, the discovery of sites, without admin consent. If the admin consent flow is not a problem you can try this workaround, use the endpoint of groups to ask for the groups that the user is member of, and you can use the groups to get the document libraries of the user.
To get the groups:
GET https://graph.microsoft.com/v1.0/me/memberOf
With the group id, you can use this endpoint:
GET https://graph.microsoft.com/v1.0/groups/{group-id}/drive
So if someone know how to do the discovery of sites for a user without admin consent, please share.
EDIT: I'm not sure why my answer was deleted, my answer basically has 2 things:
I gave notice that one answer here is not valid anymore.
I gave a possible other solution to the problem.

How to access Sharepoint site's document library via Microsoft Graph API?

I'm working on accessing document libraries for Sharepoint sites via Mircosoft Graph, but haven't had any luck so far.
Here is my setup:
I have two sites
https://mydomain.sharepoint.com
https://mydomain.sharepoint.com/teams/MyTestSite
When I make an api call to https://graph.microsoft.com/v1.0/drives, the response doesn't contain id of document library for second site (https://mydomain.sharepoint.com/teams/MyTestSite).
I have gone through documentation and haven't found anything on how to accomplish this. If anyone got any idea about this, please share.
Thanks.
I was able to figure out a solution for this. A sharepoint site is represented as a Group in Office 365. I found that out by doing some hit and trial.
So, after looking up their documentation for anything related to a Group, I got to this: https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/resources/group
And, by using the List groups endpoint I was finally able to get a list of all the Sharepoint sites which the authenticated user can access.
This API call requires Group.Read.All scope while requesting access token and only Admin users can authorize this scope. So, this will need a separate interface for Admin to list groups, potentially store the group-user mapping on my app for the user to be able to make api call (/groups/{group-id}/drive/items/{item-id}) related to the drive.
The V1.0 API has a way to list your doc lib as follows
GET https://graph.microsoft.com/v1.0/sites/mydomain.sharepoint.com:/Teams/MyTestSite:/drives
Hope this helps.
The beta API also exposes a Sharepoint endpoint.
You can also use the path if you already know your site structure:
GET https://graph.microsoft.com/beta/sharepoint:/sites

Get list of resource mailboxes from Exchange online

I'm trying to get a list of all resource mailboxes (actually only rooms) that exists on my Exchange Online tenant. All my shoots have been made using EWS, but using GetRoomLists() do not work since room lists are not created by default.
I read on MSDN that EWS cannot be used to query for the information I need so I tried doing so by using Graph API to ask directly to Azure AD for all rooms in my tenant (That's the recommended method for on-premises infrastructures, using System.Directory namespace), but I'm unable to find a way to get that information.
I did my tries with C# and Obj-C (using SOAP), so I don't mind the language used to get the information if I can get that info.
Another point is that I cannot use any kind of federated AD.
Is there someone that have any ideas of how to perform that kind of queries?

Resources