none
OneDrive For Business - Received 400 Bad request error while creating Webhook subscription RRS feed

  • Question

  • Hi,

    We are working on developing an integration with One Drive for business.
    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://<Host Name>/_api/v2.0/drive/root/subscriptions
    Content-type: application/json

    {
     "changeType": "updated",
     "notificationUrl": "<Notification URL>",
     "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.


    Wednesday, June 27, 2018 5:46 AM