我正在尝试通过提供以下JSON输入来通过Microsoft Graph创建事件:
{
"subject": "Test event",
"organizer": {
"emailAddress": {
"name": "Name 1",
"address": "name1@graffter.onmicrosoft.com"
}
},
"start": {
"dateTime": "2018-10-18T01:45:38",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-10-18T04:45:38",
"timeZone": "UTC"
},
"attendees": [
{
"emailAddress": {
"name": "Name 2",
"address": "name2@graffter.onmicrosoft.com"
},
"type": "required"
},
{
"emailAddress": {
"name": "room",
"address": "room@graffter.onmicrosoft.com"
},
"type": "resource"
}
],
"body": {
"content": "Prueba de evento",
"contentType": "HTML"
},
"location": {
"displayName": "room",
"locationEmailAddress": "room@graffter.onmicrosoft.com"
}
}
但是,有时我会收到以下错误响应(有时是我的意思):
{
"error": {
"code": "ErrorPropertyValidationFailure",
"message": "At least one property failed validation.",
"innerError": {
"request-id": "9f528d43-ed74-4c02-a29c-f01e47f24717",
"date": "2018-10-18T12:14:31"
}
}
}
问题是,使用相同的代码和相同的JSON请求(当然,更改日期),有时它可以工作,而有时却失败。
我正在关注official documentation,拥有所需的所有权限,并且我正在使用的access_token
与其他API调用(例如/messages
)完美配合。