Microsoft Graph API Create Group - microsoft-graph-api

When creating a new group that is NOT security enabled is it possible to create the group with mailEnabled set too false?
When creating the group the API seems to ignore the mailEnabled field in the request and always returns true. Also when attempting to patch the group with mailEnabled=false the api returns 204 but the mailEnabled never changes from true too false.
Is this a bug or is it simply not possible to have a mailEnabled=false group even though there is an option flag.

Although this may not be a direct answer, I would try creating the group as mail-enabled:false via the GUI. If it allows you to do this then you can confirm that the API is not working as expected.
Have a look here as well:
Mail-enable
From reading this, it seems like the mailEnabled attribute cannot receive a PATCH via the Graph API

Related

How can I create a M365 Group with a specific Preferred Data Location (PDL) using the Microsoft Graph API

I'm trying to programmatically create an M365 group with a Preferred Data Location that is different from the tenant default using the Graph API. I am trying to pass the PDL in via a PowerShell script, but when I add this command, I get a 403 Forbidden error of "InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException"
Has anyone successfully used the Graph API to create a Group (and eventually Team) in a non-default PDL?
Some technical background:
The tenant is Geo-enabled, and users have default PDLs. Default location is US, trying to create the group in CAN
Group creation is happening via a PS Script
PS script is using AAD app permissions, and has appropriate Directory.readwrite.all permissions, etc.
My script works perfectly in creating a group right I don't try to add the preferredDataLocation parameter. It only fails when I enable this specific parameter in the request body.
Thanks everyone!
As per the docs, the property preferredDataLocation can be set on the group while creating it or updating it through the REST API. Add this property in your request to the preferred data location for the group. Described here

Microsoft Graph API question: how do I get event instance data via iCalUId

Here's my problem: I am using Microsoft Graph API v1.0 and would like to get the details of an instance of a recurring calendar event. All I got is the iCalUId of the instance.
I tried this call:
https://graph.microsoft.com/v1.0/me/events?$filter=iCalUId eq 'the value of the iCalUId'
This was also suggested in Microsoft graph API: finding event by iCalUid.
This works fine for single events.
But it does not work for instances of recurring meetings: then the call returns an empty value. I just verified this in the Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer
Am I doing something wrong (even though the iCalUId is unique to the instance)? Is there a different call I could use?
This is happening because instances of recurring meetings don't actually exist on the server. When you use the /me/events endpoint, you are getting only single-instance and series masters events - it does not trigger the server to expand recurring events into individual instances.
To get server-side expansion, you have to use the /me/calendarview endpoint. This does require that you specify a date range though. For example, this works:
GET /me/calendarview?startDateTime=2020-01-31T00:00:00
&endDateTime=2020-02-29T00:00:00&
$filter=iCalUId eq '040000008200E00074C5B7101A82E00807E40204756DC3EEFFE5CC01000000000000000010000000FCE197631C1A2E4C89172A4115BEB7B5'

Returning employeeId of a user through MS Graph API

I've been trying to return the employeeId of a user through the Microsoft Graph API but so far haven't had much luck.
I'm assuming this is probably because it doesn't exist in the metadata for the user in the Graph API so makes sense.
However, the property is populated in Azure AD. If I use the AZ command prompt to query the user I can see the property. Likewise, if I query the old Active Directory Graph API endpoint I can even see it there.
For example, querying
https://graph.windows.net/{tennant}/users/{upn}?api-version=1.6 directly I receive the employeeId as part of the response (using the ActiveDirectoryClient however seems to ignore this property and doesn't store it anywhere).
Is there any reason for this? Wouldn't it make sense to have it returned as an additional property? I've also looked into extensions, but as it's not an extension isn't returned there.
Any help would be appreciated. I can get the information I need by querying the old endpoint directly, but this seems like a complete backwards step and involves multiple queries to get the information I need - including having to use multiple end points (one of which I assume will be deprecated and removed soon).
EmployeeId is currently a beta feature and is only available in the beta endpoint of the Graph API.
So if you want to access the beta endpoint you just have to change the version to beta in your url. For example:
https://graph.microsoft.com/beta/me/
https://graph.microsoft.com/beta/users/{id|upn}/
https://graph.windows.net/{tennant}/users/{id|upn}?api-version=beta
For more information about the user-object in the beta endpoint see: https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/resources/user

How can I access "waiting on" fields in the Asana API?

Asana tasks can be marked as "waiting on" other tasks. I'd like to access this data through the API, but it's either not available or undocumented.
The set of fields returned in an API response can be customised using the opt_fields parameter. I've tried adding "waiting," "waitingon" and "waiting_on" to that parameter, with no luck.
Any ideas?
Hi this is not currently supported in the public API for Asana. As a note, if you stumble across an undocumented field they are not supported and may change at any time, so be careful when dealing with such endpoints.

How to get location field from linkedin api while fetching network updates

I want to fetch location of person and connections so how should I specify fields for this purpose?
http://api.linkedin.com/v1/people/~/network/updates:(update-content:(person:(id,headline,location)))?type=CONN
If I'll make another calls for just getting location, it will be very costly for me, as it will require to make extra calls for each of new connection and will increase number of calls exponentially. So, I want some solution using which I can get location in network updates API call itself.
EDIT: And another thing I need is to check about the privacy setting of connections. As per my knowledge, linkedin doesn't provide any api which returns that which connection allows to see updates and which are not. So, when I try to get network update for a particular connection, it returns error that this user doesn't allow public to see updates. If I want to check this thing before call network updates API, how can I do it in Ruby Language.
OR
Let me know some way to pass multiple dynamic IDs while calling linkedin API.
When retrieving person data associated with a Network Update, it appears that only the basic fields are available. The solution would be to get the id for the person and make a second call to the Profile API:
http://api.linkedin.com/v1/people/id=12345:(first-name,last-name,connections,location)
Currently, linkedin doesn't provide any API for this purpose. You have to make multiple calls for this purpose. But you should make these calls in chunks to avoid timeout issues.
Reference
Try this api
`String url = "https://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,location,picture-url,positions:(title,company:(name)))"; `

Resources