>我正在尝试按照以下文档创建 webhook 订阅:https://learn.microsoft.com/en-us/graph/webhooks
但是,当我尝试开机自检到微软图形时,它给了我这个错误:"代码": ", "message": "未找到与请求 URI 'https://subscriptionstore.windows.net/1.0/subscriptions'匹配的 HTTP 资源。 "内部错误":{ "请求 ID": "10cd5a1d-56a7-44d4-9f4d-51516c7ab69c", "日期":"2019-06-10T10:54:12">
但我没有发布到那个 URL,我发布到这个:https://graph.microsoft.com/v1.0/subscriptions
这是我在Python Django-rest中的代码
outlook_token = settings.outlook_token
request_url = "https://graph.microsoft.com/v1.0/subscriptions"
headers = {"Authorization": f"Bearer {outlook_token}"}
expiration_date = datetime.utcnow() + timedelta(minutes=4000)
print(expiration_date)
expiration_date = expiration_date.strftime("%Y-%m-%dT%H:%M:%SZ")
notification_url = (
"https://9d065f52.ngrok.io/api/v1.0/user-calendar-settings/calendar-webhook"
)
payload = {
"changeType": "created,updated,deleted",
"notificationUrl": notification_url,
"resource": "/me/events",
"expirationDateTime": expiration_date,
"clientState": "SecretClientState",
}
response = requests.patch(url=request_url, headers=headers, json=payload)
抱歉,我做了一个补丁而不是开机自检这就是问题所在。