I am trying to use the drive API to test watching one of my google drive's documents...
I have created a localhost server using python flask...
This is my code for it
from flask import Flask, render_template, request, url_for
app = Flask(__name__)
@app.route('/')
def display():
user = {'nickname': 'Miguel'} # fake user
return '''
<html>
<head>
<title>Home Page</title>
<meta name="google-site-verification" content="XXXX" />
</head>
<body>
<h1>Hello, ''' + user['nickname'] + '''</h1>
</body>
</html>
'''
if __name__=='__main__':
app.run()
@app.route('/hello', METHODS=['POST'])
def hello():
return request.get_data()
I use ngrok to connect my localhost to the internet...
This doesn't even matter however because the drive API cannot connect to the server
as when I use the Google Drive API in the API explorer it gives me
{
"error": {
"errors": [
{
"domain": "global",
"reason": "push.webhookUrlUnauthorized",
"message": "Unauthorized WebHook callback channel: https://44c689c2.ngrok.io"
}
],
"code": 401,
"message": "Unauthorized WebHook callback channel: https://44c689c2.ngrok.io"
}
}
The items that I put into the body are:
{
"address":"https://44c689c2.ngrok.io",
"type":"web_hook",
"id":"abc123"
}
Is there any way to fix this?? Thanks...