{"action":"created","issue":{"url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/41","repository_url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android","labels_url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/41/labels{/name}","comments_url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/41/comments","events_url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/41/events","html_url":"https://github.com/microsoftgraph/msgraph-sdk-android/issues/41","id":208816190,"number":41,"title":"Events subscription via webhooks","user":{"login":"Surbhidhingra","id":13447801,"avatar_url":"https://avatars.githubusercontent.com/u/13447801?v=3","gravatar_id":"","url":"https://api.github.com/users/Surbhidhingra","html_url":"https://github.com/Surbhidhingra","followers_url":"https://api.github.com/users/Surbhidhingra/followers","following_url":"https://api.github.com/users/Surbhidhingra/following{/other_user}","gists_url":"https://api.github.com/users/Surbhidhingra/gists{/gist_id}","starred_url":"https://api.github.com/users/Surbhidhingra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Surbhidhingra/subscriptions","organizations_url":"https://api.github.com/users/Surbhidhingra/orgs","repos_url":"https://api.github.com/users/Surbhidhingra/repos","events_url":"https://api.github.com/users/Surbhidhingra/events{/privacy}","received_events_url":"https://api.github.com/users/Surbhidhingra/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-02-20T08:47:13Z","updated_at":"2017-02-22T23:09:26Z","closed_at":"2017-02-22T23:09:26Z","body":"Hi,\r\n\r\nI am implementing events subscription using MS graph android SDK. Below is the code.\r\n\r\n`\r\nIGraphServiceClient mGraphServiceClient = GraphServiceClientManager.getInstance(context).getGraphServiceClient();\r\nmGraphServiceClient.getSubscriptions().buildRequest().post(getSubscription(email, expirationDate), subscriptionICallback);`\r\n\r\n```\r\nprivate Subscription getSubscription(String email, Calendar expirationDate) {\r\n        Subscription subscription = new Subscription();\r\n        subscription.expirationDateTime = expirationDate;\r\n        subscription.notificationUrl = \"<Webhook link>\";\r\n        subscription.changeType = \"created,updated\";\r\n        subscription.resource = \"me/events\";\r\n        subscription.clientState = Base64.encodeToString(email.getBytes(), Base64.URL_SAFE | Base64.NO_PADDING | Base64.NO_WRAP);\r\n\r\n        return subscription;\r\n    }\r\n```\r\n\r\nThe request body generated through this always throws the error: \r\n\r\n```\r\nError during http request Error code: InvalidRequest\r\n Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?\r\nPOST https://graph.microsoft.com/v1.0/subscriptions\r\nSdkVersion : graph-android-v1.0.0\r\nAuthorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]\r\n{\"@odata.context\":\"https://graph.microsoft.com/v1.[...]\r\n400 : Bad Request\r\nE/DefaultHttpProvider[sendRequestInternal] - 286: [...]\r\nE/DefaultHttpProvider[sendRequestInternal] - 286: [Some information was truncated for brevity, enable debug logging for more details]\r\nE/DefaultHttpProvider[sendRequestInternal] - 286: Throwable detail: \r\n                                                                                                 com.microsoft.graph.http.GraphServiceException: Error code: InvalidRequest\r\n                                                                                                 Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?\r\n                                                                                                 \r\n                                                                                                 POST https://graph.microsoft.com/v1.0/subscriptions\r\n                                                                                                 SdkVersion : graph-android-v1.0.0\r\n                                                                                                 Authorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]\r\n                                                                                                 {\"@odata.context\":\"https://graph.microsoft.com/v1.[...]\r\n                                                                                                 \r\n                                                                                                 400 : Bad Request\r\n                                                                                                 [...]\r\n                                                                                                 \r\n                                                                                                 [Some information was truncated for brevity, enable debug logging for more details]\r\n                                                                                                     at com.microsoft.graph.http.DefaultHttpProvider.handleErrorResponse(DefaultHttpProvider.java:310)\r\n                                                                                                     at com.microsoft.graph.http.DefaultHttpProvider.sendRequestInternal(DefaultHttpProvider.java:246)\r\n                                                                                                     at com.microsoft.graph.http.DefaultHttpProvider.access$000(DefaultHttpProvider.java:47)\r\n                                                                                                     at com.microsoft.graph.http.DefaultHttpProvider$1.run(DefaultHttpProvider.java:129)\r\n                                                                                                     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)\r\n                                                                                                     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)\r\n                                                                                                     at java.lang.Thread.run(Thread.java:818)\r\nE/agenday.com.pgi.agenday.ui.BaseActivity: create Subscription exceptionError code: InvalidRequest\r\n                                                                                          Error message: Could not process subscription creation payload. Are all property names spelled and camelCased properly?\r\n                                                                                          \r\n                                                                                          POST https://graph.microsoft.com/v1.0/subscriptions\r\n                                                                                          SdkVersion : graph-android-v1.0.0\r\n                                                                                          Authorization : Bearer eyJ0eXAiOiJKV1QiLCJub25jZSI[...]\r\n                                                                                          {\"@odata.context\":\"https://graph.microsoft.com/v1.[...]\r\n                                                                                          \r\n                                                                                          400 : Bad Request\r\n                                                                                          [...]\r\n                                                                                          \r\n                                                                                          [Some information was truncated for brevity, enable debug logging for more details]\r\n\r\n\r\n\r\n```\r\n\r\nbut the same request body is working fine in graph explorer, \r\nI have tried many things now but unable to resolve it. Please help me how to work for subscription in android as I can't find any resources for this online.\r\n\r\nIt's urgent, appreciate your help. Thanks!"},"comment":{"url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/comments/281835585","html_url":"https://github.com/microsoftgraph/msgraph-sdk-android/issues/41#issuecomment-281835585","issue_url":"https://api.github.com/repos/microsoftgraph/msgraph-sdk-android/issues/41","id":281835585,"user":{"login":"iambmelt","id":990063,"avatar_url":"https://avatars.githubusercontent.com/u/990063?v=3","gravatar_id":"","url":"https://api.github.com/users/iambmelt","html_url":"https://github.com/iambmelt","followers_url":"https://api.github.com/users/iambmelt/followers","following_url":"https://api.github.com/users/iambmelt/following{/other_user}","gists_url":"https://api.github.com/users/iambmelt/gists{/gist_id}","starred_url":"https://api.github.com/users/iambmelt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iambmelt/subscriptions","organizations_url":"https://api.github.com/users/iambmelt/orgs","repos_url":"https://api.github.com/users/iambmelt/repos","events_url":"https://api.github.com/users/iambmelt/events{/privacy}","received_events_url":"https://api.github.com/users/iambmelt/received_events","type":"User","site_admin":false},"created_at":"2017-02-22T23:09:26Z","updated_at":"2017-02-22T23:09:26Z","body":"This issue was resolved by e63e212f8103315f776892331e3702a61c9226e9 in versions `1.1.0`+"}}
{"actor":{"display_login":"iambmelt"}}