In the beta (and v1.0) endpoints of the Microsoft graph, for "education", is there a way to add multiple teachers and members (educationUser references) to an "educationClass"?
POST /education/classes/{id}/members/$ref
{
"#odata.id":"https://graph.microsoft.com/v1.0/education/users/XXXXX"
}
Right now, it seems that one by one is added instead of batch applying this in the same fashion as when adding members and owners to teams.
Something like this? (fictive request)
"teachers#odata.bind": [
"https://graph.microsoft.com/v1.0/education/users/AAAAA",
"https://graph.microsoft.com/v1.0/education/users/BBBBB"
],
"members#odata.bind": [
"https://graph.microsoft.com/v1.0/education/users/CCCCC",
"https://graph.microsoft.com/v1.0/education/users/DDDDD"
]
Either in a separate $ref operation or directly on the educationClass creation request object.
Is this something I've just been missing when looking in the doc? If not, is this something the Microsoft Graph Education team might consider in a future version of the beta endpoint?
Currently, the group resource (and by extension educationClass) only supports adding one Owner/Member at a time. You may want to look into the JSON Batching functionality. Batching allows you to queue up to 20 Graph calls in a single request.
For managing Teacher, Student, and Class assignment at scale, I'd suggest looking at School Data Sync (SDS). SDS allows you to automatically keep your AAD in sync with a Student Information System.
Related
Following query in MS Graph Explorer displays signed-in user's profile and its manager Diego Siciliani
https://graph.microsoft.com/v1.0/me?$expand=manager
But you may notice in the response it is returning tons of attributes of manager object, as well. Some of these attributes are objects (such as assignedPlans) themselves and have their own attributes, as well.
Question: How can we filter the above query so it returns user profile (that it is already doing) along with ONLY the following attirbute value the user's manager: "displayName": "Diego Siciliani"
Remark: Following query returns the error shown below: https://graph.microsoft.com/v1.0/me?$expand=manager($select=displayName)
Invalid $select properties
Please use the below query to get user and his manager details
https://graph.microsoft.com/v1.0/users/userid?$expand=manager($levels=max;$select=id,displayName)&$select=id,displayName&$count=true
ConsistencyLevel eventual
Update https://graph.microsoft.com/v1.0/me?$expand=manager($levels=max;$select=displayName)&$count=true
It is known issue from Microsoft that nested $select combined with $expand doesn't work (i.e. $expand=some_path($select=some_field) does not work with Microsoft Graph API).
See: https://learn.microsoft.com/en-us/graph/known-issues#query-parameter-limitations
$expand:
No support for nextLink
No support for more than 1 level of expand
No support with extra parameters ($filter, $select)
I wish they would implement it because right now we either have to pull a lot of extra data (e.g. for managers), or we have to make a lot of requests per user to retrieve just the field we want.
There's a solution that deal with batch requesting but it requires a json solution: https://learn.microsoft.com/en-us/graph/json-batching?view=graph-rest-1.0
I am trying to find out who is invited to an event via Microsoft Graph API v1.0. The event gives me a list of invitees, which can also contain distribution lists. This is fine, but I really want to know the mail addresses of each and every person invited to that meeting (directly or via DL).
In the case an invitee is a distribution list, the event gives me the following information: "name": "DL Foo", "address": "DL_1234567890#global.corp.foo"
My first idea was to get the id of the DL with https://graph.microsoft.com/v1.0/groups/?$filter=startswith(displayName,'DL Foo') then list all of the members with https://graph.microsoft.com/v1.0/groups/{id}/members and do recursive calls in case any member is a nested DL.
I got an Insufficient privileges as an answer, so I can't try this for now.
Would this have been the preferred approach (then I'll lobby my organisation to change privileges)?
Is there a more elegant way to retrieve all invitees of an event via Graph API?
It appears what are you after is List group transitive members endpoint which:
Get a list of the group's members. A group can have users, devices,
organizational contacts, and other groups as members. This operation
is transitive and returns a flat list of all nested members.
So, GET /groups/{id}/transitiveMembers should return a flat list of all nested members (including members of Distribution list group)
We are working with schools who use Microsoft Education and School Data Sync (SDS) to load their teachers, students and groups. In SDS there are some properties such as Grade, GraduationYear etc. and we´ve been trying to figure out if these are accessible via the Microsoft Graph API.
With a bit of experimentation and via this article, we can see on Groups and Users certain properties we can get prefixed with extension_fe2174665583431c953114ff7268b7b3_Education_. fe2174665583431c953114ff7268b7b3 seems to be the app id for SDS.
We were wondering if this is a sensible route to get at these properties from SDS or if there is a better route for getting these? We can, for example, see the term information available in classes but we don´t see the subject information there.
For groups:
Groups: https://graph.microsoft.com/v1.0/groups/{Id}?$select=extension_fe2174665583431c953114ff7268b7b3_Education_{Name}
Note: Groups in SDS are called sections
Status (e.g.extension_fe2174665583431c953114ff7268b7b3_Education_Status)
Period - This seems to be called periods in the import files
CourseSubject - e.g. History
CourseDescription - e.g. History of the World
CourseName
CourseNumber
TermEndDate
TermStartDate
TermName
SyncSource_CourseId
SyncSource_TermId
SectionName - this is the name that comes from the SDS file
Users: https://graph.microsoft.com/v1.0/users/{Id}?select=$extension_fe2174665583431c953114ff7268b7b3_Education_{Name}
Grade
GraduationYear
SyncSource_StudentId
ObjectType - Shows if this a teacher or a student
DateOfBirth
The only supported route to access this information is through the Education Graph APIs documented here. Right now that is a subset of the properties imported by School Data Sync. The underlying extension properties should be considered a point-in-time implementation detail and not relied upon in production apps.
Current plan as of Feb 2019 is to add the course information to the educationClass object in the next couple of months. That just leaves a few properties different across the education entities which we don't have a concrete plan for yet.
I'm looking for a way to retrieve the list of people in a distribution list (contact list) in Outlook.com using the Microsoft Graph API.
So far I was able to retrieve the distribution group name etc.. using
https://graph.microsoft.com/v1.0/me/people?$search=DL_NAME
I'm certain that it's what I'm looking for because the result from API includes the following
"personType": {
"class": "Group",
"subclass": "PersonalDistributionList"
}
This is weird anyways, because it shows up using people endpoint and not the contacts.
What I need from this point on is to be able to retrieve the list of people in the distribution list. I've tried querying using the id in the result but it didn't work. Any ideas?
Couple of things...
DLs are actually represented by the group entity in Microsoft Graph, so in your case you should be able to use the id returned from your people search in the following to get the group/DLs members
GET https://graph.microsoft.com/v1.0/groups/{id}/members
You could just search for your DL by filtering on the group entity:
GET https://graph.microsoft.com/v1.0/groups?$filter=displayName eq 'DL_NAME'
The people API (see this topic) is really about people that you communicate with most often - and it includes users, groups and contacts.
Hope this helps,
I am creating a social app and will be handling large amounts of data. I have a certain part of my app where you can create four different types of events. My question is, would it be better to separate these four types into different classes: eventType_One, eventType_Two, eventType_Three, and eventType_Four to create smaller queries?
Or should I put all the events into one class events, therefore only creating one API request instead of four. On several pages I need to query through each class. I also will only have the basic plan: 30 requests
I'd create a class EventType and an Event having the EventType as a relation. So you fetch the available types once and then your desired events. You want to limit the number of API calls as much as possible to a) not exceed your free plan and b) have fewer requests on the client side.
I have created a similar social app and I modeled it after parses AnyPic. Parse uses 1 Class Activity which handles activities like: likes, comments, and follows. You can add your own events/activities to it if needed. Checkout AnyPic
If you need to do something like photo, video, or galleries, I would recommend turning the photo class into a post class and adding a type field. Either way using the AnyPic model you should be able to add activities/events as needed.