0
我試圖訂閱應用程序到Sharepoint列表。通知將通過webhook發送到應用程序。要做到這一點,你必須做出一個HTTP POST請求:Sharepoint webhooks:訂閱列表
https://{your-account}.sharepoint.com/_api/web/lists('{list-guid}')/subscriptions
身體:
{
"resource": "{{ URL of the resource Id }}",
"notificationUrl" : "{{ URL of the endpoint that will process the webhooks }}",
"expirationDateTime" : "2017-09-27T00:00:00+00"
}
呼叫需要一個訪問令牌。我通過這種方式獲得了curl令牌:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -d "client_id={{ Id of the application registered on Azure Active Directory }}&client_secret={{ Key added on Azure for the app }}&grant_type=client_credentials&resource=https%3A%2F%2F{{ My account }}.sharepoint.com" "https://login.microsoftonline.com/{{ Azure account tenant id}}/oauth2/token"
這將返回一個包含在POST請求中的標頭的標記。不幸的是,此請求失敗,錯誤代碼401正文:
{
"error_description" : "The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."
}
我覺得這個問題是不是道理,我們嘗試過很多次才停止投擲無效令牌數據相關的錯誤。
有沒有辦法來調試這個錯誤?有什麼建議麼?