I'm using the List Children of a driveItem endpoint as described https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/driveitem_list_children to list the contents of folders and using the nextLink property where appropriate. This works really well with OneDrive but when listing the driveItems inside a SharePoint site I get the first 200 items and a next link which just returns the last 2 and no further nextLink. I've also tried manually setting a $top value but this didn't help.
Not sure whether this a bug with the API but any assistance would be much appreciated.
According to your descriptions, I assume you want to use the API 'https://graph.microsoft.com/v1.0/sites/{site-id}/lists'.
Based on my test, when we list all the websites by TOP query, the ‘NextURL’ will not exist in the response, if there are less than 400 websites.
Do your SharePoint site collect have more than 400 SharePoint sites? If not, how many site do you have ?
Related
I am using Graph API to extract all the incidents and advisories from Microsoft but I encounter some issues, and I will be very happy if you can help me.
I am using the GET Method using the URL
https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues but in the output, I can see that not all incidents are present, and I can see that there is present pagination in the output https://graph.microsoft.com/v1.0/admin/serviceAnnouncement/issues?$skip=100, can you guys help me how I should filter this to extract all the incidents from the API?
You'll need to make multiple calls until the response provides no further link for you to retrieve further records.
https://learn.microsoft.com/en-us/graph/paging
As is described in the above documentation ...
You can retrieve the next page of results by sending the URL value of the #odata.nextLink property to Microsoft Graph.
As previously stated, once you have reached the last page, you will no longer have a nextLink value to retrieve the next page.
I am trying to retrieve all of the files associated with each channel within each Team. Per the Microsoft Graph REST API V1.0 documentation, it is GET /teams/{id}/channels/{id}/filesFolder.\
Please see https://learn.microsoft.com/en-us/graph/api/channel-get-filesfolder?view=graph-rest-1.0&tabs=http
However, filesFolder no longer appears as an available query. Is there still a way to achieve this?
Edit: Appears to be the same for Messages. https://learn.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-beta&tabs=csharp&viewFallbackFrom=graph-rest-1.0
Why are these queries no longer available?
You can query Groups with team-id to get the items from the group's drive directly.
You can use https://graph.microsoft.com/v1.0/groups/{team-id}/drive/root/children where /drive/root can get the Document library that the channel folders are part of and /children can display all items from the folder. Referto this doc for more details on how to get a DriveItem.
I'm using consumer OneNote in this scenario.
I have been querying my OneNote pages across a number of Notebooks using Graph with some success, but I've run into a strange issue. I'm note sure if it's a quirk in Graph or my Notebooks. I've reproduced the problem using Graph Explorer.
For example, If I issue the following request using Graph Explorer:
https://graph.microsoft.com/v1.0/me/onenote/pages?$top=100&$filter=id+eq+'0-fe674713edf84357871dbc179dfd924c!1-816F7725BEF00A5F!731388'
then I get a JSON response with the 'value' full of useful data.
If I issue the following request using Graph explorer:
https://graph.microsoft.com/v1.0/me/onenote/pages?$top=100&$filter=id+eq+'0-1f9aa8a73e9a4f14b4daa7762b5aa530!42-816F7725BEF00A5F!665027'
then I get a JSON response with an empty 'value'. All I've done is changed one known good ID for another known good ID.
I can:
Access both pages from Graph Explorer using a direct URL with the IDs used above
Access both pages using OneNote web app and Windows 10 version
Search for the 'lost' pages by title in the OneNote user interface successfully
It doesn't seem to matter what attribute of the pages I search for, the result is the same. Interestingly this only appears to affect pages from a certain point in one Notebook onward. The affected pages look OK in OneNote and load in both Web and Windows 10 version without problems.
I can create new pages in the Notebook containing the problem pages, but the new pages don't show up when I try to search for them using Graph.
Has anyone got a suggestion as to what I should try next?
EDIT:
New pages created in the problem Notebook do appear when searched for, it appears I was too impatient. The existing pages still cannot be found.
If the filtered page is not in the top 100 results, the response will be empty
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
My requirement is to search for a file in my entire SharePoint Online (SPO) using Graph apis. I have my query something like this which I use in MS Graph Explorer:
https://'my domain'.sharepoint.com/_api/search/query?Querytext='res1a2b3c4d5e'
Basically above query is to search for all the documents having title/name as 'res1a2b3c4d5e'. This works fine if I search for any existing document. If I try to search for any document which was created/uploaded just before making above call I wont get the result.
If I search for the same after couple of minutes, then the request succeeds. Where as when I try the same on my customers site where it has millions of documents. It nearly takes around 20+ hours before I can do a successful search
So does graph api work on any SPO cache?
How can I search for newly added file without having to wait for 20+ hours?
Thanks in advance.
The search results will be available only after the search content is crawled and available in search index. While you can control the crawl schedule in SharePoint On-Premise, you cannot do so in SharePoint online. Crawling frequency in SharePoint online is managed by Microsoft.
More Details