我使用python和google api python client==1.6.2与用户google Drive一起工作。一切工作都非常完美,没有任何bug,但我没有收到来自google Drive(Google Drive API Documentation)的任何推送通知。”注册你的域“成功完成”“创建通知通道”完成,通道对象返回给我。你知道吗
我的代码:
try:
drive_service.files().watch(
fileId='CPw3cbyqkoC1QMK48R24-Z2CG9w',
body=dict(
id=str(uuid.uuid4()),
resourceId='CPw3cbyqkoC1QMK48R24-Z2CG9w',
type='web_hook',
address='https://my-domain-address/web_hook'
)
).execute()
except HttpError as err:
logger.exception('HttpError {}: content={}'.format(err.uri, err.content))
答复:
{
u'resourceId': u'CPw3cbyqkoC1QMK48R24-Z2CG9w',
u'kind': u'api#channel',
u'expiration': u'1495448262000',
u'id': u'8837a4ad-98c0-4e89-8899-c07e12e3bffc',
u'resourceUri': u'https://www.googleapis.com/drive/v3/files/0B2lHB_g_GJY9RWx6UkRjWUFjSVU?acknowledgeAbuse=false&alt=json&supportsTeamDrives=false&alt=json'
}
之后,当用户修改监视的Google Drive资源时,没有任何对https://my-domain-address/web_hook
的请求。你知道吗
你知道我做错了什么吗?你知道吗
记录与我在搜索解决方案时发现的问题相关的消息:
所以我收到了对我的webhook的Google驱动请求。你知道吗
首先我认为
Nginx
正在阻止它们,但是在我看到所有请求都是POST
之后。你知道吗所以我开始考虑转发邮件请求的问题。我还使用了Django,忘记了禁用webhook的CSRF保护。这是我问题的解决办法。你知道吗
如果能帮上忙我会很高兴的。你知道吗
相关问题 更多 >
编程相关推荐