내 파일의 변경 사항을 볼 수있는 푸시 알림과 함께 드라이브 API를 사용하려고합니다.Google 푸시 알림 결과가 401 오류로 설정 됨 Unauthorized WebHook 콜백 채널
안내 양식 Google을 따르십시오.
내 단계 :
1 단계 :이
2 단계를 수행 도메인을 소유하고 있는지 확인 등록 수행이 (내가 여러 시도했다 도메인 URL)
,783,
만들기 알림 채널
이 내가 Google 앱 엔진에 배포 가지고있는은 webhook에 대한 간단한 노드 서버입니다.
/* jshint node: true */
'use strict';
const key = require('./SBSWideDomainDev.json');
const google = require('googleapis');
const express = require('express');
var path = require("path");
const logging = require('./logging');
const app = express();
app.enable('trust proxy');
app.post('/notification', (req, res, next) => {
logging.info(res.body);
res.status(200).json(res.body);
});
if (module === require.main) {
var test = 8080;
const server = app.listen(test,() => {
const port = server.address().port;
console.log(`App listening on port ${port}`);
});
}
그리고 난 file.watch의 구글 페이지에서 라이브 데모를 사용
fileId : "some FileId",
request body:
{
"type": "web_hook",
"address": "https://notif-dot-sullivan-business-solution-dev.appspot.com/notification",
"id": "e64d0c44-f9a2-4db8-8d21-94ee0904dcb7"
}
응답 : 문제가 어디 있는지 전혀 생각이없는
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://notif-dot-sullivan-business-solution-dev.appspot.com/notification"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://notif-dot-sullivan-business-solution-dev.appspot.com/notification"
}
}
, 난 정확하게 Google 가이드를 따라야했다. 그리고 제가 일하고있는 3 일이 지났습니다. (나쁜 영어 죄송합니다)
나는 자동으로 요청에 대한 OAuth 토큰을 제공하는 drive.file.watch (https://developers.google.com/drive/v3/reference/files/watch)의 라이브 데모를 사용합니다. –