I'd like to use the checkout/checkin feature on the OneDrive REST API: https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
I'm facing two issues:
1st issue - the file info API returns publication
property as published
, even the file is manually checked out
Request:
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID?select=name,id,publication
Response:
{
"id": "01KJOOXJHF77OPSR7HWVCKSTHBQJQZEBJI",
"name": "diamond.mmap",
"publication": {
"level": "published",
"versionId": "2.0"
}
}
2nd Issue - weird response of the checkout/checkin endpoint:
I'm using the endpoint as defined here https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
e.g.
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID/checkout
Responds 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"
}
}
}
Any thought what I'm missing?
The /checkin
and /checkout
endpoints are currently in beta
.
Try changing your URI's 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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With