使用Microsoft Graph获取指向Sharepoint列表图片的图像链接

时间:2018-12-10 12:18:21

标签: sharepoint microsoft-graph

我正在尝试从包含我们公司新闻的Sharepoint列表中检索一些信息。我查看了存在的各列,并意识到该图像位于名为PublishingRollupImage的列上。

我对Microsoft的呼叫如下所示: https://graph.microsoft.com/v1.0/sites/{tenant id}/lists/posts/items?$expand=fields($select=Title,body,DepartmentCompany,PublishingRollupImage)

但是-如果我拨打电话,响应将是:

{
    "error": {
        "code": "-1, Microsoft.SharePoint.Client.ClientServiceException",
        "message": "Cannot serialize data for type Microsoft.SharePoint.Publishing.Fields.ImageFieldValue.",
        "innerError": {
            "request-id": "f885269e-da21-45a0-b3e4-e304f4e01edb",
            "date": "2018-12-10T12:12:25"
        }
    }
}

这很重要,因为我通过添加此图像来发送整个图像。 But i read我可以使用.ImageUrl将其强制转换为链接,但是我不确定是否可以在这样的调用中完成。

有没有人要指点?

1 个答案:

答案 0 :(得分:0)

对象模型(CSOM / JSOM)返回对象列表,但不返回JSON,因此不需要序列化。图方式返回JSON,需要序列化操作。

目前没有可用的解决方法,因此您现在可能无法使用Graph的字段。您可以在UserVoice上提交一个功能请求。

相关问题