【发布时间】:2021-02-26 02:38:23
【问题描述】:
Env:使用沙盒和图形浏览器的开发者帐户。
我无法更新通过 schemaExtensions 添加的自定义字段。步骤如下:
POST https://graph.microsoft.com/v1.0/schemaExtensions
{
"id": {schemaName},
"description": "Meta data",
"targetTypes": [
"Event"
],
"owner": {app_id},
"properties": [
{
"name": "Pid",
"type": "String"
}
]
}
我收到 201 响应:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#schemaExtensions/$entity",
"id": "extiv30x2jc_{schemaName}",
"description": "Meta data",
"targetTypes": [
"Event"
],
"status": "InDevelopment",
"owner": {app_id},
"properties": [
{
"name": "Pid",
"type": "String"
}
]
}
然后我创建一个事件如下:
POST https://graph.microsoft.com/v1.0/me/events
{
"subject": "My event",
"start": {
"dateTime": "2021-02-25T22:45:11.110Z",
"timeZone": "UTC"
},
"end": {
"dateTime": "2021-02-25T22:45:11.110Z",
"timeZone": "UTC"
}
}
事件已成功创建,我记下了该事件的 id。然后我修补事件,因为不可能同时创建实例和更新自定义字段。
PATCH https://graph.microsoft.com/v1.0/me/events/{id}
{
"extiv30x2jc_{schemaName}": {
"Pid": "1"
}
}
为此,我得到如下 200 响应:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users({graph_explorer_profile_id})/events/$entity"
}
要搜索事件以查看自定义字段是否已更新,我使用此:
GET https://graph.microsoft.com/v1.0/me/events/{id}
但我找不到自定义字段 Pid。我在这里做错了什么?
【问题讨论】: