The OneNote Graph API allows the content of OneNote notebooks to be retreived. The section and sectionGroup resources have a lastModifiedBy and lastModifiedDate which gives us author and timestamp information.
The OneNote application itself (both web and desktop versions) exposes author information about individual edits within the HTML content of a page. Given this information is available to OneNote, can it be exposed through the Graph API?
Also, we would appreciate lastModifiedBy on the page object (it already has lastModifiedDateTime).
In theory, both asks you mentioned are possible. Could you create uservoice entries so we can track these asks?
https://onenote.uservoice.com/forums/245490-onenote-developer-apis
Related
In the MS Graph API the page IDs are in a form like this:
0-27696e96063a344f89a7735214aaa999!1-A0AC2C4AD3AAA999!34000
The second part is the MS Graph section ID.
However OneNote page links (e.g. online, or copied from the app) use UUIDs as page IDs.
How can I get the MS Graph ID from the UUID - is there some mapping? The use case is to grab a page ID from the OneNote app then immediately fetch that page from the MS Graph.
Alternatively, if there is some MS Graph query method that lets me pass information I can get from the OneNote app (e.g. Page and Section UUID) that would work fine.
This question was posed (and answered) by Velojet and Jorge Aguirre here
Basically if you get the url of a personal OneNote page https://onedrive.live.com/...|<page-id>/) Then use this approach in the MS Graph query method
GET ~/pages?$filter=contains(links/oneNoteClientUrl/href,'<page-id>')
Some of my pages have a OneNote Tag in it
https://learn.microsoft.com/en-us/graph/onenote-note-tags
I would like to retrieve only pages that contain a specific tag from a notebook.
Currently, I would need to
Get all the sections from a notebook
Get all the pages from a section
Get all content from pages
check if it contains data-tag="important" (example)
Is there a better way of doing this via the ms graph? (possibly via a combination of expand/filter)
Best
To get the pages in a notebook use the HTTP call below.
https://graph.microsoft.com/v1.0/me/onenote/pages
To compare the data-tag="important" is present in the content or not, it is not possible as of now but if your data is small you can use a work around by calling the below HTTP call and compare it for each page on your end.
https://graph.microsoft.com/v1.0/me/onenote/pages/pageid/content
If you have tons of data, it would be better to raise a Uservoice for this scenario by going to the Microsoft Graph Feedback Forum so that it can be implemented in the future.
I'm using the https://graph.microsoft.com/v1.0/me/onenote/notebooks/getRecentNotebooks endpoint to retrieve a list of the user's recent notebooks. I now want to get sections and pages for those notebooks.
getRecentNotebooks returns displayName and URLs (like oneNoteWebUrl) for each notebook, but I need an ID to use onenote/notebooks/{id}/sections. Is there a way to either:
get a list of recent sections/pages (or sections/pages of recent notebooks) directly; or
get the ID of a notebook by URL using another endpoint (in graph, I saw that there might be something in the OneNote API, but would prefer not to use that)?
The /me/onenote/notebooks/GetNotebookFromWebUrl endpoint can take care of this.
I'm trying to fetch recent files from SharePoint Online using Microsoft Graph.
The API I'm using is :
https://graph.microsoft.com/v1.0/me/drive/recent
But the results include files from all site collection. I need to restrict the results to only a single site collection.
After some research, I found that there is no direct API to restrict the site collection.
I also tried using adding filter like :
$filter=sharepointIds/siteId eq 'site-id'
but it was also not working. It gave a `501 (Not implemented) error.
Update:
I found another API from Graph which is
https://graph.microsoft.com/beta/me/insights/used
which is inside insights(beta) named "items viewed and modified by me"
But it again returns data across tenant and I need to restrict it to a single site collection. I guess filter conditions are not yet implemented for this API in Graph.
Is there any method to get recent files from a particular site collection? Any help is appreciated.
One correction, /me/drive/recent isn't pulling from all site collections, it's pulling from the current user's OneDrive. This includes recent files held within their drive and any recent changes to files that have been shared with them.
As for finding Recent Files from a SharePoint Document Library, you need to make this request within the context of the drive you want to pull from. For example:
https://graph.microsoft.com/v1.0/sites/root/drives/{documentLibraryId}/recent
We are using Microsoft Graph APIs (driveItem.search) to search the files those user can access on Sharepoint Online. But when we open the Sharepoint Online site and search at that site, the search's result from Sharepoint Online site and the search's result from API return is different.
Example:
The keyword that we are testing is "safety access" (including parenthesis)
Here is the result from Sharepoint Online site:
enter image description here
Here is the result from APIs:
enter image description here
Can anyone tell me why is it different like that?
Note: You can currently search only message and person collections.
https://developer.microsoft.com/en-us/graph/docs/concepts/query_parameters#search-parameter
https://graph.microsoft.com/v1.0/me/drives/b!05kpQIVuAkebEbnq3ftalG9eKBXqLXRJiiiQGZjVlDqML5T888BfS4YjkXMj9Exl/microsoft.graph.search(q='"Test"') will ignore the search parameter so you will see the following in the result, it just list all drive items in the site:
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)"
Meanwhile, the query in SharePoint site itself just iterate over a specific document library.