0
MS 그래프 android SDK를 사용하여 이벤트 구독을 구현하고 있습니다. 아래는 코드입니다.MS 그래프를 사용하여 webhooks를 통한 구독 구독 Android SDK
IGraphServiceClient mGraphServiceClient = GraphServiceClientManager.getInstance(context).getGraphServiceClient();
mGraphServiceClient.getSubscriptions().buildRequest().post(getSubscription(email, expirationDate), subscriptionICallback);
private Subscription getSubscription(String email, Calendar expirationDate) {
Subscription subscription = new Subscription();
subscription.expirationDateTime = expirationDate;
subscription.notificationUrl = "<Webhook link>";
subscription.changeType = "created,updated";
subscription.resource = "me/events";
subscription.clientState = Base64.encodeToString(email.getBytes(), Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);
return subscription;
}
이를 통해 생성 된 요청 본문은 항상 오류가 발생합니다 :
Error during http request Error code: InvalidRequest
Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?
POST https://graph.microsoft.com/v1.0/subscriptions
SdkVersion : graph-android-v1.0.0
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]
{"@odata.context":"https://graph.microsoft.com/v1.[...]
400 : Bad Request
E/DefaultHttpProvider[sendRequestInternal] - 286: [...]
E/DefaultHttpProvider[sendRequestInternal] - 286: [Some information was truncated for brevity, enable debug logging for more details]
E/DefaultHttpProvider[sendRequestInternal] - 286: Throwable detail:
com.microsoft.graph.http.GraphServiceException: Error code: InvalidRequest
Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?
POST https://graph.microsoft.com/v1.0/subscriptions
SdkVersion : graph-android-v1.0.0
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]
{"@odata.context":"https://graph.microsoft.com/v1.[...]
400 : Bad Request
[...]
[Some information was truncated for brevity, enable debug logging for more details]
at com.microsoft.graph.http.DefaultHttpProvider.handleErrorResponse(DefaultHttpProvider.java:310)
at com.microsoft.graph.http.DefaultHttpProvider.sendRequestInternal(DefaultHttpProvider.java:246)
at com.microsoft.graph.http.DefaultHttpProvider.access$000(DefaultHttpProvider.java:47)
at com.microsoft.graph.http.DefaultHttpProvider$1.run(DefaultHttpProvider.java:129)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:818)
E/agenday.com.pgi.agenday.ui.BaseActivity: create Subscription exceptionError code: InvalidRequest
Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?
POST https://graph.microsoft.com/v1.0/subscriptions
SdkVersion : graph-android-v1.0.0
Authorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]
{"@odata.context":"https://graph.microsoft.com/v1.[...]
400 : Bad Request
[...]
[Some information was truncated for brevity, enable debug logging for more details]
을하지만 같은 요청 본문 그래프 탐색기에서 잘 작동, 나는 그것을 해결하지만 지금 수없는 많은 것들을 시도했습니다. Android에서이 기능을 사용하려면 어떻게해야합니까?이 온라인 리소스를 찾을 수 없습니다.
낙타 - 케이싱에 대한 오류를 검색하셨습니까? – halfer
예,하지만 요청 본문에 문제가 있어야하지만 동일한 요청자가 그래프 탐색기에서 정상적으로 작동하고 있습니다. – Surbhi