webhook订阅API

时间:2017-11-20 13:12:00

标签: azure-active-directory outlook-restapi

我已按照使用Outlook REST API webhook push notification的说明进行操作。

我希望日历中的推送通知用于创建,更新和删除event实体。我在下面打电话请求:

Method Type: Post

URL: https://outlook.office.com/api/v2.0/me/subscriptions
Content-Type : application/json
Authorization : Bearer ACCESS_TOKEN

Request Body :
{

"@odata.type": "#Microsoft.OutlookServices.PushSubscription",
"Resource": "https://outlook.office.com/api/beta/me/events",
"NotificationURL": "https://krogerfreshwebhook.ngrok.io/myNotifyClient",  
"ChangeType": "Created",
"ClientState": "MySecretClientStateString"
}

但我在响应标题

中遇到错误
content-length : 0
date : Mon, 20 Nov 2017 12:58:03 GMT
request-id : 38ac0346-088f-4b43-80b2-32c6cf64b22c
status : 401
www-authenticate : Bearer client_id="00000002-0000-0ff1-ce00-000000000000", trusted_issuers="00000001-0000-0000-c000-000000000000@*", token_types="app_asserted_user_v1 service_asserted_app_v1", authorization_uri="https://login.windows.net/common/oauth2/authorize", error="invalid_token",Basic Realm="",Basic Realm="",Basic Realm=""
x-backendhttpstatus : 401, 401
x-beserver : MA1PR01MB0485
x-calculatedbetarget : MA1PR01MB0485.INDPRD01.PROD.OUTLOOK.COM
x-calculatedfetarget : MA1PR01CU001.internal.outlook.com
x-diaginfo : MA1PR01MB0485
x-feproxyinfo : MA1PR01CA0025.INDPRD01.PROD.OUTLOOK.COM
x-feserver : MA1PR01CA0025, BM1PR01CA0075
reason="ErrorCode: 'PP_E_RPS_CERT_NOT_FOUND'

消息:

'Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a 

Internal error: spRPSTicket->ProcessToken failed. 
Failed to call CRPSDataCryptImpl::UnpackData:Certificate cannot be found. Certificate required for the operation cannot be found.%0d%0a Internal error: Failed to decrypt data. :Failed to get session key. RecipientId=293577. spCache->GetCacheItem returns error.:Cert Name: (null). 
error_category="invalid_msa_ticket"
x-msedge-ref : Ref A: 0C4DE404A07C474FA67DC1A986C2DEA0 Ref B: BOM01EDGE0220 Ref C: 2017-11-20T12:58:03Zenter code here
x-powered-by : ASP.NET

其他信息:

授权网址:

login.microsoftonline.com/common/oauth2/v2.0/authorize
   ?response_type=code
   &client_id=my_clinet_id
   &redirect_uri=my_redirect_url
   &authorize
   &scope=openid,offline_access,User.ReadWrite,Mail.ReadWrite,Contacts.ReadWrite,Tasks.ReadWrite,Calendars.ReadWrite,Calendars.ReadWrite.Shared,Mail.Send,Group.Read.All,Files.ReadWrite,Files.ReadWrite.All 

当我调用日历api时,它工作正常。它给了我日历的事件列表,但当我使用相同的令牌订阅推送通知时,它给了我无效的令牌错误

0 个答案:

没有答案