を受け取っていない変更をドライブを追加しましたウェブフック通知Iは、以下の以下の私のサービスアカウントのウェブフック通知を設定
- デベロッパーコンソールでIAMの下で私のサービスアカウントの秘密鍵を生成
ステップ私のコールバックドメインは、開発者コンソールの自分のアプリケーションのドメイン検証の下にあります
以下に使用されていますコードは、私のアプリケーション
java.io.File file = new java.io.File("/xyz.p12"); FileInputStream fis = new FileInputStream(file); PrivateKey serviceAccountPrivateKey = SecurityUtils.loadPrivateKeyFromKeyStore(SecurityUtils.getPkcs12KeyStore(), fis, "notasecret", "privatekey", "notasecret"); JsonFactory jsonFactory = new JacksonFactory(); HttpTransport t = GoogleNetHttpTransport.newTrustedTransport(); GoogleCredential gc = new GoogleCredential.Builder().setTransport(t) .setJsonFactory(jsonFactory) .setServiceAccountScopes(Collections.singleton(DriveScopes.DRIVE)) .setServiceAccountPrivateKey(serviceAccountPrivateKey) .setServiceAccountId("xyz") .setServiceAccountUser("abc") .build(); Drive drive = new Drive.Builder(t, jsonFactory,null).setHttpRequestInitializer(gc) .setApplicationName("xyz").build(); Channel channel = new Channel(); String uid = UUID.randomUUID().toString(); System.out.println(" UID :: " + uid); channel.setId(uid); channel.setType("web_hook"); channel.setAddress("--- Callback URL"); StartPageToken pageToken = drive.changes().getStartPageToken().execute(); Channel c = drive.changes().watch(pageToken.getStartPageToken(), channel).execute();
(かもしれない)のコードが正常に実行され、また、私は登録の一部としてウェブフックに電話があったため、ウェブフックを登録します。
私のアプリケーションに組み込まれているドライブアカウントのドライブファイルを変更すると、Webhook通知が表示されません。誰かが私がその過程で何かを見逃しているかどうか教えてもらえますか?
ところで、私はこの質問
Google push notifications - Unauthorized WebHook callback channel