Search code examples
active-directorygoogle-directory-api

How to list all google directory subscription channels


I'm working on integration with Google Directory and create subscription channels to watch users updates using this API https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/watch

POST https://admin.googleapis.com/admin/directory/v1/users/watch

I created some channels and don't have their id and resourceId to stop them according to this documentation and now I can't create any new channels https://developers.google.com/admin-sdk/directory/reference/rest/v1/channels/stop

I didn't find any API endpoint to list all my current customer id channels to stop them. How can I stop any subscription (watch) channels related to the customer id so I can create new watchers?


Solution

  • Unfortunately, Google has not enabled support for a way to list (i.e: a LIST method) active subscriptions enabled for a given admin user/domain. The only method they've exposed is a STOP method to stop an existing subscription, but it requires the caller already know the channel metadata associated with the subscription.

    The good news here is if you did not store this information upon creation, you should be able to find the required parameters as a part of an event notification. I believe they might be in the headers accompanying each notification event.