OneNote ClassNotebook data from REST API has wrong students list - onenote

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 :)

Related

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

Android Management API: List of Enterprises/Policies?

This is driving me nuts. I've successfully followed the Android Management API Quickstart to create a project/enterprise/policy and install it on a device.
I stupidly didn't write down the enterprise or policy IDs. I tried to create a new set, but the non-enterprise email now gives an error that it's already part of another EMM.
Is there a place in the console where I can see a list of the enterprises and/or policies that I've created? Where are these stored?
Edit: I found the enterprises.get method in the API but if I put enterprises/* in the name field (per the validation) I get a 400 error indicating Invalid enterprise id. Provide a valid id. so I'm unsure how to move forward.
You can find the enterprise you created by logging into play.google.com/work with the account that was used to create it.
Click on Admin Settings to see the Organization name and Organization ID
And to find the policies of all the devices you have enrolled to this enterprise, you can simply call the API - enterprises.devices.list entering the parent in the form enterprises/{enterpriseId} [ enterpriseId here is the OrganizationID that you get from the above steps ]
This would list all the devices attached to the enterprise and in the response you can find policyName of each device.

Instagram: Is it possible to get user's name, follower numbers, and search photos with #tag?

I once asked this question.
Is it possible to use Instagram API in order to make a user list according to the number of followers?
And I am not a programmer, just a salesman.
And it seems like we cannot make this influencer finding tool by using "official" Instagram API. So I have looked for other solutions and found a way to get data from Instagram by using other API and JSON.
Please refer to these links.
https://github.com/whizzzkid/instagram-reverse-proxy
How can I get a user's media from Instagram without authenticating as a user?
Obtaining Instagram Access Token
My goal is creating an influencer finding tool, so I need to find photos with #tag and make user list accordingly to the number of followers of the user.
My question is;
1 Is it possible to get data such as user name, follower numbers, photos with certain #tag? by using non-official API and JSON?
2 And suppose we made it, then Instagram will find out our products and ban our accounts or service? It seems they do not allow us to use non-official API.
I would appreciate it if you could teach me whether we can make it or not, in a way that you talk to the person who does not know much about JSON or so.
Thank you!
Using unofficial API is always risky, its against their terms and policy.
You can use official APIs to make get this info.
You first have to make hashtag API , which gives you posts with username (no follower count), then for each user, you have make another API call to get user info, this will give you follower counts, bio and other details.
The 2 APIs needed are below, you need public_content scope permission and have to get your app approved by instagram and go to live mode.
https://api.instagram.com/v1/tags/{tag-name}/media/recent?access_token=ACCESS-TOKEN
https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN

How does OneNote differ between "View Notebooks" and "View Notebooks in Your Org"?

I'm creating an application to work with OneNote in Office 365 and so I'm creating an app registration in Azure. I want to be able to view notebooks, and there are two permission options: View notebooks and View notebooks in your organization. Irrespective of which permission I select, the only notebooks the call returns are ones in the currently authenticated user's personal site (using "https://www.onenote.com/api/v1.0/me/notes/notebooks" as the Url for the GET request).
So...is it because of the Url I'm using (I haven't found any documentation that uses anything other than ".../me/..."), or is it just working as expected? For example, there's no documentation I've found that describes what all notebooks "in your organization" means - does that include every SharePoint site collection Notebook? Something else? Any additional details or links to specific information would be appreciated.
Yes it is possible to Get Personal Notebooks in the Users OneDrive For Business (/me/) as well as Notebooks hosted in SharePoint sites(/myorganization/) that the user has access to.
Organization Notebooks -
https://www.onenote.com/api/{version}/myorganization/siteCollections/{id}/sites/{id}/notes/notebooks
You would need SiteCollectionId and SiteId to access the organization notebooks.
To understand how you get the notebooks (in the users organization) by referring to this documentation -
https://blogs.msdn.microsoft.com/onenotedev/2015/06/11/and-sharepoint-makes-three/
I did finally find the documentation where they list the different locations from which you can request notebooks: https://msdn.microsoft.com/en-us/office/office365/howto/onenote-get-content. Also, to get the gist of my question, although the service uses a common Url to access notebooks, there isn't a single location where you can ask for all notebooks in an organization. The Azure permission merely gives you the right to go get them if you can find them. As noted in the first answer above, if you know where they are at and if you have the right permissions with your app then that all works great. But you have to know where they are, because there doesn't seem to be a discovery type API for them.

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

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'