Is it possible to publish to a pub sub topic from the Google Drive Files watch API ?

1,528 views
Skip to first unread message

albuixech jérémy

unread,
Jun 12, 2017, 4:58:08 PM6/12/17
to Google Cloud Pub/Sub Discussions
I'm doing some tests and when I set the web_hook address to https://pubsub.googleapis.com/v1/projects/[...] the API returns the following error: Unauthorized WebHook callback channel: https://pubsub.googleapis.com/v1/projects/[...]

The use case being to have the google drive push notifications for file change handled through the Pub/Sub message queue. 

Jordan (Cloud Platform Support)

unread,
Jun 13, 2017, 4:04:14 PM6/13/17
to Google Cloud Pub/Sub Discussions
The push notification sent by the Google Drive API would need to be compatible with that of a Google Cloud Pub/Sub message so that it can be published to a specific Topic. There are some posts on Stack Overflow that talk about this combination. 

The alternative would be to create a Google Cloud Function that accepts messages from the Drive API, and sends the message to Pub/Sub. You would then set the URL of your Cloud Function as the Webhook in your Drive API code.   

Kir Titievsky

unread,
Jun 13, 2017, 5:10:58 PM6/13/17
to Jordan (Cloud Platform Support), Google Cloud Pub/Sub Discussions
Jeremy, 

As Jordan says, you need a proxy in the middle.  Ultimately, you have to be able to prove ownership of the destination domain and you can't do that with Pub/Sub's even if the message format was complicated. The happy news is that the proxy would be super simple.

k



On Tue, Jun 13, 2017 at 4:04 PM, 'Jordan (Cloud Platform Support)' via Google Cloud Pub/Sub Discussions <cloud-pubs...@googlegroups.com> wrote:
The push notification sent by the Google Drive API would need to be compatible with that of a Google Cloud Pub/Sub message so that it can be published to a specific Topic. There are some posts on Stack Overflow that talk about this combination. 

The alternative would be to create a Google Cloud Function that accepts messages from the Drive API, and sends the message to Pub/Sub. You would then set the URL of your Cloud Function as the Webhook in your Drive API code.   

--
You received this message because you are subscribed to the Google Groups "Google Cloud Pub/Sub Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cloud-pubsub-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cloud-pubsub-discuss/5a4c7476-e2d6-482d-a5c2-549b83465961%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Kir Titievsky | Product Manager | Google Cloud Pub/Sub 
Reply all
Reply to author
Forward
0 new messages