签入/签出文件时的Sharepoint`不支持的段类型` [英] Sharepoint `Unsupported segment type` when checkin/chekout file

查看:23
本文介绍了签入/签出文件时的Sharepoint`不支持的段类型`的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 OneDrive REST API 上的结帐/签入功能:

第 2 期 - 结帐/签入端点的奇怪响应:

我正在使用此处定义的端点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

回复:

<代码>{错误": {"code": "BadRequest","message": "不支持的段类型.ODataQuery: sites/fe688d8ed4a2/drive/items/01KJOQZEBJI/checkout",内部错误":{请求 ID":a7d18555-3e74-4aea-ad92-539481f6c33b",日期":2018-02-21T09:17:00"}}}

有没有想过我错过了什么?

解决方案

/checkin/checkout 端点当前处于 beta 中.

尝试将 URI 的根从 https://graph.microsoft.com/v1.0/ 更改为 https://graph.microsoft.com/beta/:

https://graph.microsoft.com/v1.0/sites/{siteId}/drive/items/{itemId}/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

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://docs.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

这篇关于签入/签出文件时的Sharepoint`不支持的段类型`的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆