OneDrive For Business - Received 400 Bad request error while creating Webhook subscriptions using OneDrive ReST API


OneDrive For Business - Received 400 Bad request error while creating Webhook subscriptions using OneDrive ReST API



We were working on OneDrive webhooks subscription. We tried to create subscriptions and as per the API documentation, we were sending below payload



POST https:///_api/v2.0/drive/root/subscriptions
Content-type: application/json
Headers:
Authorization: Bearer
Body
{
"changeType": "updated",
"notificationUrl": "",
"resource": "/me/drive/root",
"expirationDateTime": "2018-01-01T11:23:00.000Z",
"clientState": "client-specific string"
}



we are receiving 400 Bad Request with below response



{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect."
}
}



If we remove "changeType" and "resource" from payload, it works.



Kindly suggest the proper way to achieve the same.









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Comments

Popular posts from this blog

paramiko-expect timeout is happening after executing the command

how to run turtle graphics in Colaboratory

Export result set on Dbeaver to CSV