Sharepoint `Unsupported segment type 'when checkin / chekout file

I would like to use the checkout / checkin function in the OneDrive REST API : https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout

I ran into two problems:

1st issue - the file API returns the publication property as published , even the file is manually checked

Request:

https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID?select=name,id,publication

Answer:

 { "id": "01KJOOXJHF77OPSR7HWVCKSTHBQJQZEBJI", "name": "diamond.mmap", "publication": { "level": "published", "versionId": "2.0" } } 

enter image description here

2nd Issue - weird endpoint answer checkout / checkin:

I am using an endpoint as defined here https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout

eg. https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID/checkout

Answered with:

 { "error": { "code": "BadRequest", "message": "Unsupported segment type. ODataQuery: sites/fe688d8ed4a2/drive/items/01KJOQZEBJI/checkout", "innerError": { "request-id": "a7d18555-3e74-4aea-ad92-539481f6c33b", "date": "2018-02-21T09:17:00" } } } 

Has anyone thought I am missing?

+7
rest sharepoint onedrive microsoft-graph
source share
1 answer

/checkin and /checkout endpoints are currently in beta .

Try changing your URI root from https://graph.microsoft.com/v1.0/ to https://graph.microsoft.com/beta/ :

 https://graph.microsoft.com/v1.0/sites/{siteId}/drive/items/{itemId}/checkout 
+1
source share

All Articles