Can groups be expanded when querying which students are associated with a class notebook? - onenote

We currently query for the list of students associated with a class notebook via:
/api/v1.0/me/notes/classnotebooks/{id}/students
Should a group be associated with the class notebook then we get principalType=Group and an id in the form:
c:0o.c|federateddirectoryclaimprovider|{id}
So is it possible to expand the members of the associated group(s) within this call? If not, what is the format of this id? To use it via the graph api requires an id so is it safe to assume that the id will always be the 3rd piped element?
Thanks

I ran into this for my application as well. After conferring with the onenote team a few months ago it came down to that you cannot expand these groups inside the onenote api. You must authenticate to the graph api and use the groups functions there. The downside of this is that the graph api permissions to expand a group require an administrator to grant them. So in the end all I could do was recommend the users create class notebooks using the student email list rather than an azure group. (on your final point the format should remain consistent the third piped element is the group id you can pass the graph api)
specifically the below endpoint to get a groups members
'https://graph.microsoft.com/v1.0/myorganization/groups/' . $group_id . '/members'

Related

Get drive files stats (views/openings) | Google Drive API

I've been searching the docs but I can't find anything.
The goal is to retrieve different stats from our files. Actually, we can retrieve almost everything we need, except for the document openings and document openings per user.
So here is the question: How can I retrieve document views of a drive document (a G Sheet to be more precise) ? Can I segment it by user ?
Thank you
I understand that your goals are the following one:
You want to retrieve document views
Of a particular document (and you know it's id)
Associated to a specific user
Please correct me if I get it wrong. If those are your goals, then you can use the Admin SDK as pointed out by Rubén in the comments. Now I am going to detail how you can make such a request easily.
You could use the method activities.list() to get a list with what you want. You only have to populate these four parameters:
Parameter
Value
Description
userKey
The user's email
Determine the user
applicationName
drive
Identifies the Google service
eventName
view
Designate the type of activity
filters
doc_id=={MY DOCUMENT ID HERE}
Filters by the document
That configuration will provide you with your desired data. Leave a comment below if you need help creating that request in your own environment.

Export the join date for members in a group

Is it possible to export a member's join date to a google group? When you manually export a .csv from a group it gives information on the join date. However, in google app script, I don't see the option for this in the Groups Service. This is the information that is in the .csv:
Any help or resources would be appreciated!
Short answer:
No, you cannot do that programmatically.
Long answer:
Google Groups functionality is mainly handled by Directory API, in its Groups and Members resources. That's what the Apps Script Groups Service is using behind the scenes, and you could use its methods directly by enabling the Admin SDK Directory Service in your script (the APIs —and, as a result, the advanced services— usually have greater functionalities than the Apps Script built-in classes).
If you look at the properties of any of these resources (Groups and Members), you won't find anything close to a join date property, so it doesn't seem to be part of the open API, and can only be accessed through the UI.
The same can be said of Groups Settings API, which can be used to manage group settings: no join date can be found in its resources.
Because of this, you have no way to programmatically store and retrieve the group member's join dates.
Workaround (of a sort):
If you are adding members to a group programmatically, with the API method Members: insert, you could make your application store the date in which each member was added, and retrieve it later. This is not possible, though, if members are added through the UI.
Filing a Feature Request:
Since this resource does seem to exist already (it can be accessed through the UI), I'd suggest you to file a feature request in this Issue Tracker component to make this available to the API. If you do that, please make sure that you explain the usefulness of this functionality (explain how this could help you and, potentially, other users).
Reference:
Directory API: Groups
Directory API: Members
Directory API: Manage Groups

Forge API: Get all changed items

I need to get a list of all changed items in my project in BIM 360. Can I do this using forge-api.
Ho, regarding with the latest question [If my service is not available and I will miss some webhook events, how can I get all the changes that were made after the last webhook event received] :
If your requirement is to know which items are changed in one folder of Docs, Search API with filter can be of use. e.g. the endpoint below will return all items which are updated since a certain time.
https://developer.api.autodesk.com/data/v1/projects/{{project_id_with_b}}/folders/{{one_folder_id}}/search?filter[attributes.lastModifiedTime]-ge=2019-10-15
More filters options are described at
https://forge.autodesk.com/en/docs/data/v2/developers_guide/filtering/
While if you wanted to know all updates in one call, I do not see currently the way is available. While, Activity API is on the way, it might be helpful to know all activities during a certain dates, then you could filter out what you are interested in and locate the corresponding module>>files/resources etc.. but Activities may probably be categorized with specific scopes e.g. admin activities, project actives, issue activities etc. so it is not one call knows all updates.. And these APIs may not be exposed in the same time.

OneNote ClassNotebook data from REST API has wrong students list

I'm running OneNote add-in that use OneNote REST APIs.
While investigating an issue from one of our user, I found the class notebook data from REST API only have one student in students field but the user said that there are more in OneNote app.
So, here is data from REST API. And I asked their class notebook manage screen and there is only one - But they see lists in OneNote app.
Is this something different type of notebook?
The response indicates that single student entry is a group (see 'principalType'), while the teachers are of type 'Person'. It looks like the students were added as a group, which is why you only see that group in the API response and in the Add/Remove students screen. That group was expanded into its individual students when the notebook was created. The teacher will see the students in the OneNote client, but only the group in the Class Notebook Creator app.
You can use the Azure AD APIs to get the list of students who are part of that group.
By the way, the API response and screenshots you included contain some personal information that you may want to remove :)

Is there any way to get a information on activities performed by a specific box user through box api?

Say I want to know what all operation a box user "x" has performed in last week. Is there any way to acheive this via box api??
Or for that matter given a file id can we get a list of all the activities performed.??
If you are the administrator of a Box enterprise and the user is within your enterprise, you can do one of two things:
Fetch all events in the enterprise within your timespan of interest and manually filter them to the particular user using the event.created_by.login. You can filter to a particular file using the event.source.id property.
Fetch the particular user's events using the On Behalf Of API.
Otherwise, you can only fetch events for the user represented by the Bearer token.