签入/签出文件时,Sharepoint`不支持的段类型' [英] Sharepoint `Unsupported segment type` when checkin/chekout file
问题描述
我想在OneDrive REST API上使用检出/检入功能: https://docs.microsoft.com/zh-CN /onedrive/developer/rest-api/api/driveitem_checkout
I'd like to use the checkout/checkin feature on the OneDrive REST API: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
我面临两个问题:
第一期-文件信息API将publication
属性返回为published
,即使文件是手动签出的
1st issue - the file info API returns publication
property as published
, even the file is manually checked out
请求:
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID?select=name,id,publication
响应:
{
"id": "01KJOOXJHF77OPSR7HWVCKSTHBQJQZEBJI",
"name": "diamond.mmap",
"publication": {
"level": "published",
"versionId": "2.0"
}
}
第二期-签出/签入端点的奇怪响应:
2nd Issue - weird response of the checkout/checkin endpoint:
我正在使用此处定义的端点 https://docs.microsoft.com/zh-CN /onedrive/developer/rest-api/api/driveitem_checkout
I'm using the endpoint as defined here https://docs.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_checkout
例如
https://graph.microsoft.com/v1.0/sites/SITE_ID/drive/items/FILE_ID/checkout
回复:
{
"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?
推荐答案
/checkin
和 /checkout
端点当前位于beta
中.
尝试将URI的根目录从https://graph.microsoft.com/v1.0/
更改为https://graph.microsoft.com/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
这篇关于签入/签出文件时,Sharepoint`不支持的段类型'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!