checkout status of a onedrive file using microsoft graph api - microsoft-graph-api

I am trying to check wether a onedrive file has been checked out using microsoft-graph. According to the documentation https://learn.microsoft.com/en-us/onedrive/developer/rest-api/resources/driveitem , there is a publication property of a DriveItem. But this property is not returned by default. But the documentation does not mention how to retrieve this property.

I recommend you review the Use query parameters to customize responses documentation page. You can use $select to choose which properties are returned in the API response.
I believe your query would look something like:
GET https://graph.microsoft.com/v1.0/me/drive/items/{ITEM ID}?$select=publication
You can try this query in the Graph explorer with our demo account at https://developer.microsoft.com/en-us/graph/graph-explorer?request=me/drive/items/01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K?$select=publication&method=GET&version=v1.0&GraphUrl=https://graph.microsoft.com

Related

How to read the attachment of sharepoint online lists using the Graph API

For Attachment Items in any list of SharePoint Online, graph explorer can get only Attachments property which contains value “true” or “false”.
Using Rest API we can easily expand and grab the attached links. However, Using Graph Explorer we can not expand the Attachments property.
The below query I have tried in Graph Explorer: https://graph.microsoft.com/v1.0/sites/{site-id}/lists/{list-id}/items/{item-id}
Attachments: true
How can we get the attachments.
Retrieving List Item attachment details is not supported.
So far, you can use only Sharepoint REST API
As #user2250152 said, currently this is not supported in Graph API. You could submit the feature request here: https://techcommunity.microsoft.com/t5/microsoft-365-developer-platform/idb-p/Microsoft365DeveloperPlatform

Microsoft graph API: /me/drive/root/search - can't add filters to query

I'm trying to make search request for my OneDrive files with some specific extensions. Only solution I've got right now is to filter out after received response but that's not what I'm looking for.
Query I tried:
https://graph.microsoft.com/v1.0/me/drive/root/search(q='book filetype:xlsx OR filetype:xls OR filetype:svg OR filetype:json OR filetype:txt')
Unfortunately it's not returning anything.
AFAIK, the search endpoint will search the keyword like 'book' with all the extensions and give the driveItem objects as response. You need to filter it on your end which extension you like to pick by writing the code. Please raise a feature request in Microsoft Graph Feedback Forum so that the Product team may implement it in future.

How to fetch GlobalObjectId using List Calendar View Graph API call?

I understand the recommended way to uniquely identify an Outlook meeting is to use the GlobalObjectID (or CleanGlobalObjectId), rather than iCalUID. I am struggling to find a way to extract this value when using Microsoft Graph's CalendarView endpoint
I've read through this page here, and that is what drives my question - MSDN Question on iCalUID vs GlobalObjectId
At present, I am using Microsoft Graph's List CalendarView view date range query params, and $select and $filter OData attributes
While it's true that you should rely on the Event's id, I'm not sure where the concern over iCalUId stems from. Regardless, GloablObjectID is not a property returned from the Outlook APIs.
There is a preview of immutable identifiers for Outlook resources on the beta endpoint but keep in mind that this is not suitable for production use yet.

Sort file list by lastModifiedDateTime

I want to sort a file list by lastModifiedDateTime property of the fileSystemInfo property, like this:
https://graph.microsoft.com/v1.0/groups/9e8fd8af-b7fe-4cfe-9b16-81e8358f3bec/drive/root/children?$orderby=fileSystemInfo/lastModifiedDateTime%20desc
I get an 'notSupported' error message from API
Is this supported, or is the syntax wrong?
Yes, i can repro the issue as well. Sounds like filtering by lastModifiedDateTime is not supported for OneDrive for Business. It is supported for OneDrive Personal. The limitation is not specific to the Microsoft Graph endpoint. There is a note about it in the referenced documentation page.
Please refer the older thread - Filtering Onedrive items by lastModifiedDatetime

Search sharePoint for specific contentType with MsGraph

I need to get sharePoint sites which contain specific type of items.
As I see on this docs
https://learn.microsoft.com/en-us/graph/query-parameters
searching is only supported for messages and persons, so I would need to know up-front in which sites and lists to look for the items of the given type or use the sharePoint api not the msGraph.
Am I correct or there is some other way?
For the files, you can use /search endpoint to perform search in the OneDrive and inside SharePoint/Group document libraries. Per documentation, you can use one of the following:
GET /drives/{drive-id}/root/search(q='{search-text}')
GET /groups/{group-id}/drive/root/search(q='{search-text}')
GET /me/drive/root/search(q='{search-text}')
GET /me/drive/search(q='{search-text}')
GET /sites/{site-id}/drive/root/search(q='{search-text}')
GET /users/{user-id}/drive/root/search(q='{search-text}')
For example, to retrieve all Excel files in user's OneDrive, you would perform such request:
GET /me/drive/root/search(q='.xlsx')
More info: https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0

Resources